I need to validate the color of some image objects inside a web page. We have red,green,yellow etc . These colors are pointing towards some live status. So it will come dynamically. I need to check which color is coming.
Hi,
I have 1 doubt, did these are images of different color or there is one object whose color will get changed as per status.
if color is changing then u can refer the below code:
Code:
Set ctrlWebEl = Browser("Welcome to Gmail").Page("Welcome to Gmail").WebElement("Welcome to Gmail")
Set objWebEl = ctrlWebEl.Object
sColor = objWebEl.currentStyle.color
'or u can use
sBackgrColor = objWebEl.currentStyle.backgroundColor
if these are different objects of different color then add these objects in OR with unique properties and use if conditions to identify which object is displayed and proceed further.
Let me know if this works for you --
Sometimes when the object have color..Their runtime property text ..might have color in it -
e.g. Green color object might have runtime text Name_GRN