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