How to retrive XML file data in QTP ? using Script(Chandana)
Answers were Sorted based on User's Feedback
Answer / kr
In QTP9.0 it supports XML input data.here also same as in
QTP8.2 we can import .xml files into user defined
Environment Variable section.
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / sandipgami84
Hi Chandana,
u can retrive data from database(XML fromet)..
u can use SQL..
LIKE e.g. Select * FROM TableName For XML Type, AUTO
Sandip
Cell No: 09986645937
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / nidhi jain
Chandan, below is solution
Const XMLDataFile = <your file path>
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
Set nodes = xmlDoc.SelectNodes(<provide you node hierarchy>)
MsgBox "Total books: " & nodes.Length
Set nodes = xmlDoc.SelectNodes("<node hierarchy>/text()")
' get their values
For i = 0 To (nodes.Length - 1)
Title = nodes(i).NodeValue
MsgBox "Title #" & (i + 1) & ": " & Title
Next
I hope this will be helpful.
| Is This Answer Correct ? | 9 Yes | 5 No |
Answer / fayaz
We can load environment variables from an xml file.
File --> Settings and click the "Environment" tab
You can see a check box "Load environment variables "
check it and give the path of the xml file.
when u run QTP , the variables in XML file will be
available.
And you can retrieve those values using Environment.value
("variable_name") from any actions.
Hope this will answer your question
| Is This Answer Correct ? | 7 Yes | 4 No |
Answer / reddy
shilpa u can not understanding what is the requirement of
chandana.
what she asking is how to retrieve xml file data using
script in qtp
ex: u have data in datatable that all the will be retrive
in xml format using script
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / shilpa reddy
chandana,we cannot apply xml data directly to script,first
we should import data into runtime datatable using import
sheet/import methods.using datatable methods we can apply
this values in our required location in the script.I
provided script for this in further answers,check it out
once.
| Is This Answer Correct ? | 4 Yes | 9 No |
Browser("Las Vegas Hotels - Las").Page("Vegas Hotels - Hotels").Link("Luxor") ......here Luxor is a hotel and this is recognised as a link. I have many hotels like Luxor, Palms etc which are all displayed as link...How do I parametrize this by using webtable functions??? ASAP
What is data driver in qtp? Where we use it?
HOw to add the recovery file at runtime to the test file .
Hi we are using QTP9.0 for Seibel Application and this seibel application will give you a popup messagebox which is of web , so qtp takes 3 mins to recognize the messagebox and to click on it , we have more number of messageboxes like this . please suggest me some solution
How can i use Output Check points in QTP
how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and next day same page is having 60 links. if i run same programe it should display total links in webpage ?
Can you write a script for to insert array elements in an excel A to Z columns only. if the number oe elements in the array is greater than the number of columns (A to Z), come to next row and proceed furthur. eah cell should contain only one array value.
How do function returns a value?How can we pass one function value to other function as input
what time u r using data driven test in ur app"
what is clean sweep?
What type of problems one will face with QTP , if too many browsers are opened at a time?
what is the difference between modular framework & datadriven framework