Micro Focus QTP (UFT) Forums

Full Version: How to get current style formats in Chrome
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
This seems to be a non-standard property as mentioned on MDN docs.
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.