LabeledLocator when clicked on a button

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

LabeledLocator when clicked on a button

Postby verellen » Thu May 07, 2009 5:42 am

Hello everyone,

Im having a bit of a problem while trying to make an GUI test for my application im writing in Eclipse RCP.
The following thing occurs:
Im recording a test and i click on two buttons, but WindowTester makes from it:

public void testWindowTesterAddUser() throws Exception {
IUIContext ui = getUI();
ui.click(2, new TreeItemLocator("prdbebe125081/test4bart",
new ViewLocator("SVN_ADMIN_APP.TreeView")));
ui.click(new LabeledLocator(StyledText.class,
"Fill in the users that you want to add, seperated with a ;"));
ui.enterText("bverelle");
ui.click(new LabeledLocator(Button.class, "Name(s):"));
ui.click(new LabeledLocator(Button.class, "Name(s):"));

ui.wait(new ShellShowingCondition("Confirm"));
ui.click(new ButtonLocator("OK"));
ui.wait(new ShellDisposedCondition("Confirm"));
ui.click(new ButtonLocator("Save changes locally"));
// ui.close(new SWTWidgetLocator(Shell.class, "RUM4SVN"));
//ui.wait(new ShellDisposedCondition("RUM4SVN"));
}

And here lies the problem, Name(s): is a label on the same editor. And if i run the test, it give an error:
(the problem is in bold)

com.windowtester.runtime.WaitTimedOutException: Timed out waiting for condition:
toString=shell titled: Confirm to show
class=com.windowtester.runtime.swt.condition.shell.ShellShowingCondition
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:775)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:747)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:740)
at com.jnj.svn_admin.testing.WindowTesterAddUser.testWindowTesterAddUser(WindowTesterAddUser.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at com.windowtester.runtime.common.UITestCaseCommon.access$001(UITestCaseCommon.java:25)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:136)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:157)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)


If i change it to:
ui.click(new ButtonLocator("Check names"));
ui.click(new ButtonLocator("Add user(s)"));

because this is what it should be, it works fine. Is this some kind of bug, or just an error somewhere in my code?

Kind regards,
Bart Verellen
verellen
 
Posts: 4
Joined: Thu May 07, 2009 4:28 am

Re: LabeledLocator when clicked on a button

Postby Phil Quitslund » Fri May 08, 2009 10:15 am

This is a bug in the recorder -- the good news is it should be fixed! If you grab the latest beta you should see the recorder properly handling this case. If not, please let us know!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: LabeledLocator when clicked on a button

Postby verellen » Mon May 11, 2009 1:11 am

Hi,

Thanks for the reply. I'll check out the latest beta. I'll let you know, if the problem still occurs.

Regards,
Bart Verellen
verellen
 
Posts: 4
Joined: Thu May 07, 2009 4:28 am

Re: LabeledLocator when clicked on a button

Postby Phil Quitslund » Mon May 11, 2009 10:38 am

Perfect; thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest