i using below code fetching font size of "link" on ie.
browser("bb").page("pp").link("link").object.currentstyle.fontsize
however, if use same code on firefox, qtp/uft throws error:
object required "object.currentstyle".
after alot of research , exploration found firefox not object.currentstyle
, object.style
inbuilt function in qtp, , used below code
browser("bb").page("pp").link("link").object.style.fontsize
but i'm not fetching results firefox
i had similar issues when switching between browsers. ie has special style object not supported in other browsers. suggest more generic tactic, treat style - html attribute. go pure dom, lets use uft test objects:
step 1: find html node want extract style from:
set element = browser("creationtime:=0").page("title:=helloworld").webelement("xpath:=//html/body/div[@id='something']")
step 2: extract style data
attributevalue = element.object.getattribute("style")
attributevalue string containing style attribute data, can split, regexp'd or ever need
Comments
Post a Comment