Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get current style formats in Chrome
#1
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
Reply
#2
This seems to be a non-standard property as mentioned on MDN docs.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  The .Object method is not working on Firefox\Chrome.Is there any alternative to this kmandadi 0 2,773 05-15-2014, 05:53 PM
Last Post: kmandadi
  How to disable automatic chrome updates for chrome 30, WIn7 maruthiyadav 2 3,349 02-26-2014, 12:34 PM
Last Post: maruthiyadav

Forum Jump:


Users browsing this thread: 2 Guest(s)