Menu bar is clicked too soon: sleep before pushMenu fixes the problem.
org.netbeans.jemmy.JemmyException: Exception during Menu pushing: (JMenuItem with text "menu0", JMenuItem with text "submenu", JMenuItem with text "radio")
at org.netbeans.jemmy.operators.Operator.produceTimeRestricted(Operator.java:747)
at org.netbeans.jemmy.operators.Operator.produceTimeRestricted(Operator.java:766)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:231)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:284)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:337)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:453)
at org.netbeans.jemmy.scenario.MenuButtonTextTest.testRadioMenu(MenuButtonTextTest.java:113)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Inner exception:
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.desktop/java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2054)
at java.desktop/java.awt.Component.getLocationOnScreen(Component.java:2028)
at org.netbeans.jemmy.drivers.input.MouseRobotDriver.getAbsoluteX(MouseRobotDriver.java:129)
at org.netbeans.jemmy.drivers.input.MouseRobotDriver.moveMouse(MouseRobotDriver.java:88)
at org.netbeans.jemmy.operators.ComponentOperator.moveMouse(ComponentOperator.java:552)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.smartMove(DefaultJMenuDriver.java:164)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.push(DefaultJMenuDriver.java:97)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.push(DefaultJMenuDriver.java:117)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.pushMenu(DefaultJMenuDriver.java:78)
at org.netbeans.jemmy.operators.JMenuBarOperator$1.launch(JMenuBarOperator.java:236)
at org.netbeans.jemmy.operators.JMenuBarOperator$1.launch(JMenuBarOperator.java:231)
at org.netbeans.jemmy.ActionProducer.launchAction(ActionProducer.java:325)
at org.netbeans.jemmy.ActionProducer.run(ActionProducer.java:288)
org.netbeans.jemmy.JemmyException: Exception during Menu pushing: (JMenuItem with text "menu0", JMenuItem with text "submenu", JMenuItem with text "radio")
at org.netbeans.jemmy.operators.Operator.produceTimeRestricted(Operator.java:747)
at org.netbeans.jemmy.operators.Operator.produceTimeRestricted(Operator.java:766)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:231)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:284)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:337)
at org.netbeans.jemmy.operators.JMenuBarOperator.pushMenu(JMenuBarOperator.java:453)
at org.netbeans.jemmy.scenario.MenuButtonTextTest.testRadioMenu(MenuButtonTextTest.java:113)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Inner exception:
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.desktop/java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2054)
at java.desktop/java.awt.Component.getLocationOnScreen(Component.java:2028)
at org.netbeans.jemmy.drivers.input.MouseRobotDriver.getAbsoluteX(MouseRobotDriver.java:129)
at org.netbeans.jemmy.drivers.input.MouseRobotDriver.moveMouse(MouseRobotDriver.java:88)
at org.netbeans.jemmy.operators.ComponentOperator.moveMouse(ComponentOperator.java:552)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.smartMove(DefaultJMenuDriver.java:164)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.push(DefaultJMenuDriver.java:97)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.push(DefaultJMenuDriver.java:117)
at org.netbeans.jemmy.drivers.menus.DefaultJMenuDriver.pushMenu(DefaultJMenuDriver.java:78)
at org.netbeans.jemmy.operators.JMenuBarOperator$1.launch(JMenuBarOperator.java:236)
at org.netbeans.jemmy.operators.JMenuBarOperator$1.launch(JMenuBarOperator.java:231)
at org.netbeans.jemmy.ActionProducer.launchAction(ActionProducer.java:325)
at org.netbeans.jemmy.ActionProducer.run(ActionProducer.java:288)