with the recorder I record the following snippet:
- Code: Select all
ui.click(new MenuItemLocator("Edit/Find\\\\/Replace..."));
but that does not work:
- Code: Select all
com.windowtester.runtime.WidgetNotFoundException: com.windowtester.swt.WidgetNotFoundException: Widget NOT Found:
Hierarchy matcher (Composite matcher with 2 component matchers:
[0] Exact Class matcher (org.eclipse.swt.widgets.MenuItem)
[1] Name Or Label matcher (Find\\/Replace...)
, Instance matcher (Menu {*Wrong Thread*})) in shell: Shell {XXX}
at com.windowtester.swt.WidgetNotFoundException.getAdapter(WidgetNotFoundException.java:40)
at com.windowtester.internal.runtime.selector.ClickHelper.doClick(ClickHelper.java:181)
at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:65)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:83)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:286)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:76)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:294)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:69)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:277)
at com.mycompany.mypackage.myTest(myTest.java:254)
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)
Caused by: com.windowtester.swt.WidgetNotFoundException: Widget NOT Found:
Hierarchy matcher (Composite matcher with 2 component matchers:
[0] Exact Class matcher (org.eclipse.swt.widgets.MenuItem)
[1] Name Or Label matcher (Find\/Replace...)
, Instance matcher (Menu {*Wrong Thread*})) in shell: Shell {XXX}
at com.windowtester.event.selector.swt.MenuItemSelector.resolveAndClick(MenuItemSelector.java:174)
at com.windowtester.event.selector.swt.MenuItemSelector.click(MenuItemSelector.java:142)
at com.windowtester.event.selector.swt.MenuItemSelector.click(MenuItemSelector.java:107)
at com.windowtester.runtime.swt.locator.MenuItemLocator.click(MenuItemLocator.java:89)
at com.windowtester.internal.runtime.selector.ClickHelper.doClick(ClickHelper.java:178)
... 18 more
Why is this "Wrong Thread" message? The line in which the exception occurs is that one mentioned above. When I omit the line, the rest of the test works. Commands like
- Code: Select all
ui.click(new MenuItemLocator("Edit/Select All"));
I also tried:
- Code: Select all
ui.click(new MenuItemLocator("Edit/Find\\/Replace..."));
- Code: Select all
ui.click(new MenuItemLocator("Edit/Find/Replace..."));
I am clueless now.
Michael