Simple RCP Contact playback fails

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

Simple RCP Contact playback fails

Postby otter606 » Mon Apr 07, 2008 3:43 am

Hello,
I'm evaluating WindowsTester for an EClipse RCP app. However I'm having some problems just getting the example Contacts RCP to work.
I'm running Windows XP , Eclipse 3.3.1.1.

I record some information in the 'New Contact' dialog, click finish and then quit. The resulting class is generated:

Code: Select all
   public void testtest3() throws Exception {
      IUIContext ui = getUI();
      ui.click(new MenuItemLocator("File/New Contact..."));
      ui.wait(new ShellShowingCondition(""));
      ui.enterText("ds");
      ui.keyClick(WT.TAB);
      ui.enterText("njmnhm");
      ui.keyClick(WT.TAB);
      ui.enterText("mnmm,n");
      ui.keyClick(WT.TAB);
      ui.enterText("mnmnmn");
      ui.close(new SWTWidgetLocator(Shell.class, "RCP Contacts Editor"));
      ui.wait(new ShellDisposedCondition("RCP Contacts Editor"));
   }


When playing back, the app fires up, the text boxes are filled in ok. Nothing happens for a few seconds, then the dialog disappears, a few seconds pause again and the test fails (stack trace below). I've tried altering
the preferences to wait longer following a widget click; pausing the record before quiting with no success. I'm sure I'm doing something very obviously wrong, any suggestions appreciated.

com.windowtester.runtime.WidgetNotFoundException: Widget NOT Found:
SWTWidgetLocator(org.eclipse.swt.widgets.Shell, RCP Contacts Editor)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:470)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:445)
at com.windowtester.runtime.swt.internal.UIContextSWT.findWidget(UIContextSWT.java:563)
at com.windowtester.runtime.swt.internal.UIContextSWT.close(UIContextSWT.java:376)
at guiTests.test4.testtest4(test4.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:26)
at com.windowtester.runtime.common.UITestCaseCommon$1.run(UITestCaseCommon.java:133)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:150)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)

Cheers
Richard Adams

Senior Software Developer, University of Edinburgh
otter606
 
Posts: 1
Joined: Mon Apr 07, 2008 3:22 am

Re: Simple RCP Contact playback fails

Postby Phil Quitslund » Tue Apr 08, 2008 10:57 am

Interesting... try removing the call to close the shell. (This is probably not what you want anyway since that will close the application and make it unavailable to later tests in the suite and the test framework will close it for you when the tests are complete.) Failing that, or if you want to dig deeper, ping support and we can follow-up there.

wintest-support@instantiations.com

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