I'm currently in the process of evaluating Window Tester and I have few issues that I should fix before we take our final decision.
One of the major issue is the following:
After a dialog is opened or closed,I have very often the UnableToFindActiveShellException Exception. I read your forum but didn't find any clue to solve this.
I'm using windowTester 3.7.1 (2009-02-19) with Eclipse 3.4.0 Build id: I20080617-2000
When the test run I didn't move the mouse or didn't click the mouse button, but I remarked that the dialog (or view, or editor) that should have the focus don't
1- If during the execution, at the right instant (!!!), I click on the item that should have the focus, the test continue with success. I didn't find a way to keep the focus.
2- I also try to change the way the item is located by using a different Locator but it didn't work.
3- I also try to add wait condition just before the execution of the locator but it never worked.
4- I also try to add ui.pause operation but it also failed. (However it helps me to click on the window to give the focus)
Here a some examples that cause the problem:
Example1:
- Code: Select all
// Example 1: After a wizard is closed, I switch the view to Project explorer in a group of views
public void testTest5() throws Exception {
IUIContext ui = getUI();
ui.click(new ContributedToolItemLocator("newWizardDropDown"));
ui.wait(new ShellShowingCondition("New"));
ui.click(new FilteredTreeItemLocator("LiveLab Project"));
ui.click(new ButtonLocator("&Next >"));
ui.enterText("Project1");
ui.click(new ButtonLocator("&Finish"));
ui.wait(new ShellDisposedCondition("New LiveLab Project"));
//------------------------ Next Line will failed ------------------
ui.click(new CTabItemLocator("Project Explorer"));
...
}
Example 2
- Code: Select all
// Example 2: I open the preferences and then try to click an item of one of my page
public void testTest4() throws Exception {
IUIContext ui = getUI();
ui.click(new MenuItemLocator("Window/Preferences"));
ui.wait(new ShellShowingCondition("Preferences"));
ui.click(new FilteredTreeItemLocator("LiveLab/Directories"));
//------------------------ Next Line will failed ------------------
ui.click(new NamedWidgetLocator("emtpInstallationFolderText"));
}
Here is the traceback of the first example
- Code: Select all
com.windowtester.runtime.swt.finder.UnableToFindActiveShellException
at com.windowtester.finder.swt.WidgetFinderService.collectMatchesIn(WidgetFinderService.java:81)
at com.windowtester.finder.swt.WidgetFinderService.collectMatches(WidgetFinderService.java:69)
at com.windowtester.finder.swt.SWTWidgetFinder.findAll(SWTWidgetFinder.java:70)
at com.windowtester.runtime.WidgetLocator.findAll(WidgetLocator.java:429)
at com.windowtester.runtime.swt.internal.UIContextSWT.findAll(UIContextSWT.java:636)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:571)
at com.windowtester.internal.runtime.selector.ClickHelper.doFind(ClickHelper.java:192)
at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:58)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:87)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:296)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:80)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:304)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:73)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:287)
at com.opalrt.livelab.ui.tests.Test5.testTest5(Test5.java:41)
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)
Thanks for your help.
Vincent