I'm currently creating a script that requires to verify certain button colors. I can't see any procedures/actions that I can use to verify button colors for swing application.
Is it possible to get JButton
color using Javascript or Python script?
I'm currently creating a script that requires to verify certain button colors. I can't see any procedures/actions that I can use to verify button colors for swing application.
Is it possible to get JButton
color using Javascript or Python script?
thanks to @quant, i was able to create a script for this posting it for reference
ColorList = {
"java.awt.Color[r=211,g=211,b=211]": "GRAY",
"java.awt.Color[r=255,g=0,b=0]": "RED",
"java.awt.Color[r=255,g=255,b=0]": "YELLOW",
"java.awt.Color[r=255,g=255,b=102]": "LYELLOW",
"java.awt.Color[r=0,g=255,b=0]": "GREEN"
}
com = rc.getComponent("$(Component)")
RGBcolor = com.getBackground()
foundcolor = ColorList.get(str(RGBcolor))
rc.checkEqual(foundcolor, "$(expectedcolor)", "Check Color")
print (foundcolor)
Ok, here is a script that adds a corresponding checker. It also knows a "few" more color names (thanks to cindyxiaoxiaoli, see https://stackoverflow.com/a/20670056/3009636 for his color name list) ...
After running this script you can then record the corresponding color check