What is Document object Model?
A platform- and language-independent standard object model for representing HTML or XML and related formats.

When can we use DOM?

One of the very important places you can use it is when a QTP web table checkpoint doesn’t show you the desired content in a cell. I mean the content in the cell is in a format that is not supported by the web table checkpoint. Another use can be when you want to access all the HTML tags used in a webpage. You can get the names, the innertext, innerHTML property of all these tags. The possibilities are endless.
How can we use DOM to access the source page?

We can access the source page of any webpage using .object notation.

Any practical example of using DOM?

I have created a demo web page to show you document object model in action. Say you want to find the font color used for writing Happy Holidays Everyone in cells of the webtable given on this page. The algorithm would be:

1. Access the DOM of webtable using .object notation.
2. Access the tagname corresponding to the property you wish to find out. In our case tagname is “font” and property to be explored is “color”.

3. Find the count of total number of tags and loop it find out the font-color.

The corresponding VB script would be:

set font=Browser("B").Page("P").WebTable("H").Object.all.tags("font")

msgbox font.length

For i=0 to font.length-1
Msgbox font(i).color

XML Code To Get Root Child Nodes

On error resume next
Set xmlDoc = XMLUtil.CreateXML()
If Err.Number <> 0 Then
Msgbox "Invalid XML"
End If
Set Root = xmlDoc.GetRootElement()
Set objChildNodes = Root.ChildElements()
numberof = objChildNodes.count()
msgbox numberof
On error goto 0 

Encrypt PWD

str = "Some Text"
encrStr = Crypt.Encrypt(str)


  1. I like your writing style, it was very clear to understanding the concept well; I hope you ll keep your blog as updated.
    Loadrunner course in Chennai|Best Loadrunner training institute in chennai|Qtp training Chennai|Qtp course in Chennai

  2. Thanks for sharing the valuable post. Kanhasoft is the well known Custom PHP Web Developer in India. We providing outsourcing services to USA, UK, Europe, Canada, Germany, UAE, Dubai, Australia, France, Brazil, Turkey, Singapore, Japan, Saudi Arabia, Ukraine, Spain, Belgium, Netherlands, Luxembourg, New Zealand, Argentina, South Africa, Greece, Denmark, Poland, Switzerland and more. Visit our site to know more.

  3. The blog you have shared is very much helpful to know more about the selenium. Thanks for your information about the selenium.
    selenium testing training
    selenium testing course
    selenium training classes
    selenium classes
    selenium training course

  4. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    Useful Information, your blog is sharing unique information....

    Selenium Automation testing

  5. I am in searching of the best place to live in. The blog you have shared helps me a lot to know the advantages of living in a township.

    Flats for sale in Chennai
    Builders in Chennai
    Flats in Chennai
    Apartments in Chennai
    New flats for sale in Chennai