Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating xml through qtp
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi
Is there any way we can update attribute values in an xml file through qtp?
I tried a few ways but was not able to do it...
1. Using XML checkpoint
2. Using excel format of xml

Suggestions invited!!
Thanks
Ankush
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
In short:
- Load the XML in an XML-object by using XMLUtil
- Find the node you're looking for with ChildElementsByPath and GetRootElement()
- Updating element-values can be done with the SetValue method (but this is not what you're looking for, right?)
- I'm not sure if updating attribute-values can be done right away, but using RemoveAttribute and AddAttribute will do the trick

There's a little more to it than that, especially step 2, you can find details in QTP Help. And of course you have to understand how to use XPath.
Check out http://www.w3schools.com
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 3,157 08-20-2013, 10:23 PM
Last Post: luckyexpert
  Exract data from XML using QTP cowboy49 3 15,154 03-27-2012, 10:19 AM
Last Post: cowboy49
  Need URGENT help how to read xml string / xml tag value in web page using QTP VQTP 2 5,966 04-16-2009, 02:27 AM
Last Post: VQTP
  Reading XML document from QTP sailakshmi 1 3,816 09-09-2008, 02:57 PM
Last Post: vamshiram

Forum Jump:


Users browsing this thread: 2 Guest(s)