Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need URGENT help how to read xml string / xml tag value in web page using QTP
#2
Not Solved
You can use XML dom method to read the file.

Sample code:

Code:
Const XMLDataFile = "C:\TestData.xml"

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)

' For setting the node

Set nodes = xmlDoc.SelectNodes("/bookstore/book") ' This is the nodes in the xml file
MsgBox "Total books: " & nodes.Length

Set nodes = xmlDoc.SelectNodes("/bookstore/book/title/text()")

' get their values
For i = 0 To (nodes.Length - 1)
    Title = nodes(i).NodeValue
    MsgBox "Title #" & (i + 1) & ": " & Title
Next
Reply


Messages In This Thread
RE: Need URGENT help how to read xml string / xml tag value in web page using QTP - by Tarik Sheth - 04-15-2009, 01:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,566 10-01-2019, 10:44 AM
Last Post: shilpi952
  Reading XML Data from a WebPage shaan.mishra87@gmail.com 1 2,251 09-28-2016, 09:16 PM
Last Post: supputuri
  DP Web Browser/Page issues rstimers 1 2,495 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  XML FILE COULD NOT BE PARSED tripathy.pilu23 1 8,192 04-18-2014, 06:38 AM
Last Post: kgovadav
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,943 03-05-2014, 09:39 PM
Last Post: nidhitaneja

Forum Jump:


Users browsing this thread: 1 Guest(s)