-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
None
-
generic
-
os_x
Jemmy version : V2
JDK version : JDK8 and above
Platform : Mac Osx
new JCheckBoxMenuItemOperator(frame,"Save") and
new JRadioButtonMenuItemOperator(frame, "Open") are not getting created in Mac Osx.
In MacOsx, once the JCheckBoxMenuItem and/or JRadioButtonMenuItem objects are created, these are not getting added directly to the parent window/frame. It is adding to another window and that window is adding to parent window as owned window. So parent.getComponents() won't list this new window and components inside that window. So component searcher is not able to find out the corresponding menu item objects in the parent frame.
How to reproduce:
Attached the test case .
Compile SampleMenuApp.java and SampleMenuAppTest.java, keep jemmy in classpath
Run java SampleMenuAppTest, keep jemmy in classpath
Error Message:
Error:
"Wait JCheckBoxMenuItem with text "Open" loaded (ComponentOperator.WaitComponentTimeout)" action has not been produced in 230558 milliseconds
Printed component in the frame from Windows and Mac OSx:
Windows:
comp :javax.swing.JPanel[null.glassPane,0,0,382x355,hidden,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JCheckBoxMenuItem[,1,3,65x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@12edcd21,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Open]
comp :javax.swing.JRadioButtonMenuItem[,1,24,65x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@34c45dca,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Save]
comp :javax.swing.JPopupMenu[,0,0,67x47,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$PopupMenuBorder@52cc8049,flags=264,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=9,desiredLocationY=57,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
comp :javax.swing.JPanel[,0,21,67x47,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JPanel[null.contentPane,0,23,382x332,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JMenu[,0,0,31x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@45fd0ab5,flags=256,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=File]
comp :javax.swing.JMenuBar[,0,0,382x23,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuBarBorder@5b6f7412,flags=392,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
comp :javax.swing.JLayeredPane[null.layeredPane,0,0,382x355,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=false]
comp :javax.swing.JRootPane[,9,36,382x355,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
MacOsx:
comp : javax.swing.JPanel[null.glassPane,0,0,400x378,hidden,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
comp : javax.swing.JPanel[null.contentPane,0,22,400x356,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
comp : javax.swing.JMenu[,0,0,42x21,alignmentX=0.0,alignmentY=0.0,border=com.apple.laf.AquaMenuBorder@41cb0ead,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=File]
comp : javax.swing.JMenuBar[,0,0,400x22,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=com.apple.laf.AquaMenuBarBorder@7ba4f24f,flags=392,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
comp : javax.swing.JLayeredPane[null.layeredPane,0,0,400x378,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]
comp : javax.swing.JRootPane[,0,22,400x378,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
So we ca clearly see JRadioButtonMenuItem and JCheckBoxMenuItem are missing Mac Osx
Note: By mistake test code files are added multiple times, SampleMenuApp.java and SampleMenuAppTest.java are correct files.
JDK version : JDK8 and above
Platform : Mac Osx
new JCheckBoxMenuItemOperator(frame,"Save") and
new JRadioButtonMenuItemOperator(frame, "Open") are not getting created in Mac Osx.
In MacOsx, once the JCheckBoxMenuItem and/or JRadioButtonMenuItem objects are created, these are not getting added directly to the parent window/frame. It is adding to another window and that window is adding to parent window as owned window. So parent.getComponents() won't list this new window and components inside that window. So component searcher is not able to find out the corresponding menu item objects in the parent frame.
How to reproduce:
Attached the test case .
Compile SampleMenuApp.java and SampleMenuAppTest.java, keep jemmy in classpath
Run java SampleMenuAppTest, keep jemmy in classpath
Error Message:
Error:
"Wait JCheckBoxMenuItem with text "Open" loaded (ComponentOperator.WaitComponentTimeout)" action has not been produced in 230558 milliseconds
Printed component in the frame from Windows and Mac OSx:
Windows:
comp :javax.swing.JPanel[null.glassPane,0,0,382x355,hidden,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JCheckBoxMenuItem[,1,3,65x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@12edcd21,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Open]
comp :javax.swing.JRadioButtonMenuItem[,1,24,65x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@34c45dca,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Save]
comp :javax.swing.JPopupMenu[,0,0,67x47,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$PopupMenuBorder@52cc8049,flags=264,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=9,desiredLocationY=57,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
comp :javax.swing.JPanel[,0,21,67x47,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JPanel[null.contentPane,0,23,382x332,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
comp :javax.swing.JMenu[,0,0,31x21,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@45fd0ab5,flags=256,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=File]
comp :javax.swing.JMenuBar[,0,0,382x23,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$MenuBarBorder@5b6f7412,flags=392,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
comp :javax.swing.JLayeredPane[null.layeredPane,0,0,382x355,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=false]
comp :javax.swing.JRootPane[,9,36,382x355,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
MacOsx:
comp : javax.swing.JPanel[null.glassPane,0,0,400x378,hidden,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
comp : javax.swing.JPanel[null.contentPane,0,22,400x356,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
comp : javax.swing.JMenu[,0,0,42x21,alignmentX=0.0,alignmentY=0.0,border=com.apple.laf.AquaMenuBorder@41cb0ead,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=File]
comp : javax.swing.JMenuBar[,0,0,400x22,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=com.apple.laf.AquaMenuBarBorder@7ba4f24f,flags=392,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
comp : javax.swing.JLayeredPane[null.layeredPane,0,0,400x378,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]
comp : javax.swing.JRootPane[,0,22,400x378,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
So we ca clearly see JRadioButtonMenuItem and JCheckBoxMenuItem are missing Mac Osx
Note: By mistake test code files are added multiple times, SampleMenuApp.java and SampleMenuAppTest.java are correct files.