Custom Search

Tuesday, May 10, 2011

QTP - How to get font size/color background color and other attributes of WebElement

Dim ctrlWebEl, objWebEl

Set ctrlWebEl = Browser("Welcome to Gmail").Page("Welcome to Gmail").WebElement("Welcome to Gmail")
Set objWebEl = ctrlWebEl.Object
sColor = objWebEl.currentStyle.color
sBackgrColor = objWebEl.currentStyle.backgroundColor
sFontSize = objWebEl.currentStyle.fontSize
sFontStyle = objWebEl.currentStyle.fontStyle
sFontFamily = objWebEl.currentStyle.fontFamily
sFontWeight = objWebEl.currentStyle.fontWeight



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.