LayoutComposite not found

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

LayoutComposite not found

Postby uweheldt » Thu Apr 01, 2010 5:05 am

Hi,

the recorder created the following JUnit code which contains references to the org.eclipse.ui.forms.widgets.LayoutComposite class. The import can not resolved? Any suggestions?

public void testBuchung() throws Exception {
IUIContext ui = getUI();
ui.click(new SWTWidgetLocator(Label.class,
"An outline is not available.", new ViewLocator(
"org.eclipse.ui.views.ContentOutline")));
ui.click(new MenuItemLocator("Buchung/Neue Buchung erfassen"));
ui.wait(new ShellDisposedCondition(
"Lade Nachschlagedaten des Editors..."));
ui.click(new LabeledTextLocator("Buchender Kunde:"));
ui.enterText("Paneur");
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator(
"PANEUROPA (73600, Paneuropa - Rösch GmbH)"));
ui.click(new LabeledTextLocator("Quelle Buchungsdaten:"));
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator("Fax"));
ui.click(new TableItemLocator("",
new SWTWidgetLocator(Table.class, new LabeledLocator(
LayoutComposite.class, "Buchungspositionen"))));
ui.click(new TableItemLocator("",
new SWTWidgetLocator(Table.class, new LabeledLocator(
LayoutComposite.class, "Buchungspositionen"))));
ui.click(new TableItemLocator("",
new SWTWidgetLocator(Table.class, new LabeledLocator(
LayoutComposite.class, "Buchungspositionen"))));
ui.enterText("PANEUR");
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator(
"PANEUROPA (73600, Paneuropa - Rösch GmbH)"));
ui.ensureThat(new ShellLocator(
"KMS - Kombiverkehr Kapazitätsmanagementsystem [null]")
.isClosed());
ui.wait(new ShellDisposedCondition("Progress Information"));
ui.wait(new ShellShowingCondition("Save Resource"));
ui.click(new ButtonLocator("&No"));
ui.wait(new ShellDisposedCondition("Save Resource"));
ui.wait(new ShellDisposedCondition(
"KMS - Kombiverkehr Kapazitätsmanagementsystem [null]"));
}
uweheldt
 
Posts: 4
Joined: Thu Apr 01, 2010 4:57 am

Re: LayoutComposite not found

Postby Phil Quitslund » Thu Apr 01, 2010 9:24 am

Aha. This class is package private. We're working on better support for eclipse forms that will remedy this issue. In the meantime, can you possibly name the table widget?

http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/programmer/core/naming_widgets.html

Having done that the recorder will generate a NamedWidgetLocator instead of referring to the Composite.

If not, please send a note to support:

wintest-support@instantiations.com

where we will open an enhancement request to track the issue.

Thanks for your report!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: LayoutComposite not found

Postby ajbetz » Wed Feb 09, 2011 9:17 am

Hello,

I am running into the same issue on my test ... the LayoutComposite class cannot be imported. I have some lines of code in which my generated test is attempting to use this class, and is causing compilation errors.

Here is an example of the code in question:

Code: Select all
ui.click(new XYLocator(new SWTWidgetLocator(LayoutComposite.class,
            new ViewLocator("com.agent.ui.wizards")), 755, 369));


I am not greatly familiar with the implementation of the UI, so I cannot provide any additional details other than this. I reviewed your link for naming this widget, but not sure if this could be accomplished with this segment of code.
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: LayoutComposite not found

Postby keertip » Thu Feb 10, 2011 9:06 am

What is the click for? A screenshot would help.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: LayoutComposite not found

Postby ajbetz » Thu Feb 10, 2011 9:19 am

I'm not entirely sure what this click was in reference too ... I tried re-recording my script, this time being very cautious and noting each thing that I was clicking so I could identify the offending widget. After re-recording, I could not get that LayoutComposite class to be used, which looks like it is only used whenever there is a click on an "empty space" in the application (ie, not on an swt widget, so the generator has to guess). I think the first time around, I got a little bit click-happy :D
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: LayoutComposite not found

Postby keertip » Mon Feb 14, 2011 8:41 am

Glad to have got the recording working.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest