This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Jemmy throws IllegalComponentStateException when a button is not made visible and an attempt to push the button is performed. We are not able to reproduce it, since the exception was sent in an anonymous bug report. See the stack trace below for more info: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location at getLocationOnScreen_NoTreeLock (java.awt.Component:1678) at getLocationOnScreen (java.awt.Component:1652) at getAbsoluteX (org.netbeans.jemmy.drivers.input.MouseRobotDriver:130) at moveMouse (org.netbeans.jemmy.drivers.input.MouseRobotDriver:70) at clickMouse (org.netbeans.jemmy.drivers.input.MouseRobotDriver:79) at push (org.netbeans.jemmy.drivers.buttons.ButtonMouseDriver:57) at push (org.netbeans.jemmy.operators.AbstractButtonOperator:334) at doClick (jeek.handlers.AbstractButtonHandler$AutomationContext:161) at invoke0 (sun.reflect.NativeMethodAccessorImpl:-2) at invoke (sun.reflect.NativeMethodAccessorImpl:39) at invoke (sun.reflect.DelegatingMethodAccessorImpl:25) at invoke (java.lang.reflect.Method:585) at callMethod (jeek.handlers.TestHandler$AutomationContext:409) at automate (jeek.handlers.TestHandler:128) at trueRunAction (jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:240) at runAction (jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:167) at run (jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:123)
Folks, I have encountered this issue as well. I have been able to replicate the problem when running Java 1.5 on Mac OS X. The issue doesn't seem to surface with Java 1.4 on the Mac, nor does it seem to appear on either Java 1.4 or 1.5 on Windows XP. My stacktrace is below. It appears to be identical to the original report. Sincerely, David Kane java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:1678) at java.awt.Component.getLocationOnScreen(Component.java:1652) at org.netbeans.jemmy.drivers.input.MouseRobotDriver.getAbsoluteX(MouseRobotDriver.java:130) at org.netbeans.jemmy.drivers.input.MouseRobotDriver.moveMouse(MouseRobotDriver.java:70) at org.netbeans.jemmy.drivers.input.MouseRobotDriver.clickMouse(MouseRobotDriver.java:79) at org.netbeans.jemmy.drivers.buttons.ButtonMouseDriver.push(ButtonMouseDriver.java:57) at org.netbeans.jemmy.operators.AbstractButtonOperator.push(AbstractButtonOperator.java:334) at gov.nih.nci.lmp.gominer.gui.GoMinerGuiSystemTest.runCategoryMenuOption (GoMinerGuiSystemTest.java:636) at gov.nih.nci.lmp.gominer.gui.GoMinerGuiSystemTest.testXMLReport(GoMinerGuiSystemTest.java: 111)
Created attachment 28206 [details] One of two files that can recreate the problem when running under Java 1.5 on Mac OS X
Created attachment 28207 [details] Two of two files that can recreate the problem when running under Java 1.5 on Mac OS X
Folks, I have uploaded a pair of files that I believe reproduces this issue. I am not sure what version of Jemmy we were using when I first noticed the problem, but the error shows up when using the latest build. The problem surfaces on Mac OS X, running Java 1.5. With the earlier version of jemmy we were using, this test case passes under Java 1. 4 on Mac OS X. (I think the latest Jemmy binary is compiled for Java 1.5) I had to tweak the code a bit to run on the PC, but I was able to replicate the problem under Windows XP under Java 1.5. Sincerely, David Kane
Created attachment 28208 [details] One of two files that can recreate the problem when running under Java 1.5 on Windows XP
Created attachment 28209 [details] Two of two files that can recreate the problem when running under Java 1.5 on Windows XP
David, thank you for your test case. It clarifies it a lot. The problem is in way you are using JMenuItemOperator.push(). This method is inherited from AbstractButtonOperator and in fact it is not intended to be used by JMenuItemOperator instance. Instead of this: final JPopupMenuOperator menuOperator = new JPopupMenuOperator(); menuOperator.waitComponentEnabled(); final JMenuItemOperator menuItemOperator = menuOperator.showMenuItem("B"); assertTrue(menuItemOperator.isVisible()); menuItemOperator.push(); you should use this: final JPopupMenuOperator menuOperator = new JPopupMenuOperator(); menuOperator.pushMenu("B"); It does what you want and moreover the code is clearer. I am resolving this issue as 'wontfix'. Feel free to re-open or add a comment if you think my resolution is wrong.