Micro Focus QTP (UFT) Forums
Need to get background color of a webelement whose class is iframe - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Need to get background color of a webelement whose class is iframe (/Thread-Need-to-get-background-color-of-a-webelement-whose-class-is-iframe)



Need to get background color of a webelement whose class is iframe - sundari_msls - 01-02-2012

I used the following script to retrieve the background color:
Code:
MsgBox Browser.Page.Link.WebElement.Object.currentStyle.backgroundColor

But, it is displaying only "Transparent". The link's class name is iFrame.
I changed it to:
Code:
MsgBox Browser.Page.WebElement.Object.currentStyle.backgroundColor

Now the background is displayed as #fff. But the actual background color is orange.

Please suggest.


RE: Need to get background color of a webelement whose class is iframe - sshukla12 - 01-03-2012

Hi,

If u want to get the background color of a link as u have mentioned in "MsgBoxBrowser.Page.Link.WebElement.Object.currentStyle.backgroundColor" , then u can simply go for getRopropertyupports the background color for some objects like link.

U can try this
Code:
Browser("Welcome to Gmail").Page("Welcome to Gmail").Link("About Gmail").GetROProperty("background color")

Regards,
Sankalp


RE: Need to get background color of a webelement whose class is iframe - sundari_msls - 01-03-2012

Sankalp,
It is not working. blank text is displayed.

when i use the currentStyle am getting the value as transparent. Can i get the exact value of color.