Micro Focus QTP (UFT) Forums
How to get current style formats in Chrome - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: General (https://www.learnqtp.com/forums/Forum-General)
+--- Forum: Posting Guidelines/Disclaimer (https://www.learnqtp.com/forums/Forum-Posting-Guidelines-Disclaimer)
+--- Thread: How to get current style formats in Chrome (/Thread-How-to-get-current-style-formats-in-Chrome)



How to get current style formats in Chrome - Koteswara Rao - 02-22-2018

Hi,

The below code is working fine when i run in IE, but when i run in chrome by recognizing the objects in repository it's throwing the error "Object required: 'currentStyle'"

Could you please help in  providing the commands to run in Chrome


Dim objLink, objweb1

Set objLink = Browser("Login page").Page("Login page").WebButton(ObjectName)

Set objweb1 = objLink.Object

stextcolor = objweb1.currentStyle.color

sfontFamily = objweb1.currentStyle.fontFamily

sfontStyle = objweb1.currentStyle.fontStyle

sfontSize = objweb1.currentStyle.fontSize

sfontweight = objweb1.currentStyle.fontWeight

sbackgroundColor = objweb1.currentStyle.backgroundColor
sheight = Browser("Login page").Page("Login Page").WebButton("Registrar").GetROProperty("height")

Regards,
Koteswara Rao


RE: How to get current style formats in Chrome - Ankur - 02-23-2018

This seems to be a non-standard property as mentioned on MDN docs.


RE: How to get current style formats in Chrome - ratnakar.e - 01-17-2020

Hi Ankur,

when i tried with below code it is working fine in IE 11 browser.
Browser("").Page("").WebEdit("").Object.currentStyle.borderColor

Question :
same code when i run in chrome browser then i am getting " OBJECT REQUIRED" error.
Can you please let me know the solution.