I am currently evaluating WindowTester for Swing. I have used SWT version before with success. Now I need swing testing.
I record a simple test, this is what is recorded:
ui.click(new JMenuItemLocator("File/New/New Project"));
Here's how the UI looks:
When I run the test, I get this:
com.windowtester.runtime.WidgetNotFoundException: Component not found JMenuItemLocator("New Project"):
class=class com.conceptwave.servicedesigner.main.NewMainFrame
name=frame0
title=ConceptWave Design Studio
at com.windowtester.internal.swing.UIContextSwing.find(UIContextSwing.java:219)
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.internal.swing.UIContextSwing.click(UIContextSwing.java:64)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:80)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:73)
at com.conceptwave.servicedesigner.tests.WTTest.testWT(WTTest.java:59)
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:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
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)
I tried this (first two work, third one fails):
ui.click(new JMenuLocator("File"));
ui.click(new JMenuLocator("New"));
ui.click(new JMenuLocator("New Project"));
I tried keyboard shortcuts, that didn't work either.
Any ideas?
Thanks!