Hello,
I am trying to record an action of a JSpinner component from my swing application using the WindowTester Pro tool. The tool recorded it successfully and was able to generate a JUnit test. However, when I ran it I received a MutipleWidgetsFoundException. Below is the stack trace:
com.windowtester.runtime.MultipleWidgetsFoundException: Multiple Components found
at com.windowtester.internal.swing.UIContextSwing.find(UIContextSwing.java:196)
at com.windowtester.internal.runtime.selector.ClickHelper.doFind(ClickHelper.java:187)
at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:52)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:140)
at com.windowtester.internal.swing.UIContextSwing.click(UIContextSwing.java:57)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:133)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:126)
at Test.test(Test.java:25)
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$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:130)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:151)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:40)
Here the test code the tool generated at line 25: ui.click(new JButtonLocator(""));
I also verified that I'd named my JSpinner (NOT JButton) component from the source code. However, I don't understand why the tool picked up a JButtonLocator here.
Does anyone have any idea how to resolve this issue?
Thanks very much for your help!
Keico