How to access Document Object Model(DOM) through QTP

Posted On June 12, 2010

Filed under QTP

Comments Dropped leave a response

Please find the below few lines which gives an idea of accessing the document object model of a browser.

Set MyPageObj= Browser(“YourBrowser”).Page(“YourBrowser”).object

For Each Item in MyPageObj.all
Print “TagName:” & chr(32) & Item.TagName
Print “InnerText:” & chr(32) & Item.InnerText
Print “Value:” & chr(32) & Item.innerHTML
Print “Title:” & chr(32) & Item.Title
Print “id:” & chr(32) & Item.id
Print “==============================================”
Next

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.