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 |
What is QTP’s model for test creation?
I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.
How will you handle the situation when object is not captured during record?
Hi I am new to QTP. can u please answer to my qus... suppose 3 excel sheets are there * we are trying to check for login credentials for a page. userid from excel1 , password is from excel2 whether the page is opened or not that checkpoint is result is should be stored in excel 3.... this qus i have faced in IBM technical round... please tell script for above query ... please please
What are the QTP advantages and disadvantages?
What is positive test case and Negative Test case? What is the meaning of Real World Scenario's?
HOW to invoke any recorded script in QTP with out using RECORD & PLAYBACK CONCEPT?
Hi i have a webtable which is having 7 columns and 6 rows of data in that table of 4th and 5 th column each row is partiotioned into 3 sub rows i want to verify in each partitioned rows of corresponding row for ex values will be like this 0 / 1 ,26/28.if it is 0/1 i want to skip only if any num/num greater than 1 i want to click.
What is the main difference between desriptive programming and generic functions
can we call runaction in the funcion
how can i use text check point in descriptive programming. or else is there any way to compare the text in the application and the text in data table.
How do you create a library file