Micro Focus QTP (UFT) Forums
Getting background color of an object on mouse over - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Getting background color of an object on mouse over (/Thread-Getting-background-color-of-an-object-on-mouse-over)



Getting background color of an object on mouse over - Surya - 03-28-2012

I have an object(link) which on mouse over will turn in blue color and the font becomes bold. I verified the object's properties before and after mouse over and observed that there is no change.
Is there a way to get the background color of that object?
I think we can use object.style, but let me know what exactly we need to call there.

Thanks in advance!!
Surya.


RE: Getting background color of an object on mouse over - sshukla12 - 04-02-2012

Hi,

U can use DOm i.e. .object property.
below written lines might help u:
.currentStyle.backgroundColor

Regards,
Sankalp


RE: Getting background color of an object on mouse over - vensas3181 - 06-27-2018

(04-02-2012, 10:46 AM)sshukla12 Wrote: Hi,

U can use DOm i.e. .object property.
below written lines might help u:
.currentStyle.backgroundColor

Regards,
Sankalp

Hi There,

using currentStyle.backgroundcolor it's returning value as "#c60c30" not actual name of color. Is there a way we can get actual name of the color like vnRed, vbGreen and so On.