XML Read Functions - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: XML Read Functions (/Thread-XML-Read-Functions) |
XML Read Functions - Nish - 11-25-2011 Iam a beginner in QTP and working for Energy services in Europe and the reason in writing this mail is i am facing problem in writing functions for reading data from our test harness scripts in which we get the result in an XML file . The requirement/task was it will be easiest to be pass down the full path name from the server for the file, as each night part of the test server set up is to copy all the files A number of new QTP functions require to be written to support the a number of the user stories. These functions will read the ASA test harness script(Testdata XML and extract the following information: - The Switching List bounded by <SwitchingList> and </SwitchingList> - The Circuit Information for each Possible Restoration options held. Information to be captured for this function will be: For each Potential Outage ID - Possible Restoration details - There may be more than one set of possible restoration options for a given outage - The full circuit information (There may be more than one circuit per Possible Restoration block) [/quote]as mentioned above i need to pass these values to GUI and get the result which matches the xml data which i have attached to this post..[attachment=861] RE: XML Read Functions - nil111 - 11-26-2011 Use Following function to reading data from the XML U have to pass the XML file name and Node name as argument for this function Hope this will help you. With Best Regards, Nil111 Code: Function Fn_GetXMLNodeValue(XMLDataFile, sNodeName) RE: XML Read Functions - Nish - 11-26-2011 i Many Thanks NIL for ur Reply...and as u said i have the file name and node name to the function as below and res is giving false when i ran the code...my actual doubt is how to read data from the list and populate the into a data table in QTP so that i can grab the data from the data table into the script and verify the result with some other elements in the same XML file ( i have attached) kindly elaborate with ref to my xmlfile... Code: Dim res |