cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parse - document load and parse from local disk

Highlighted
Contributor

XML Parse - document load and parse from local disk

Hi, i need parse easy xml doc. if I upload a file as a string it's all right. But how do I load a file?

<root>
<name>
Giada De Laurentiis
</name>
<price>
30.00
</price>
</root>


My parse code:
// to - do - this i need load and parse data from file
var xmlString = "<root><name>Giada De Laurentiis</name><price>30.00</price></root>";
var xmlDataObj = ParseXML(xmlString);
Log.Message(xmlDataObj.getElementsByTagName('price')[0].childNodes[0].nodeValue);


 

I try code from https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou... but it does not work for me..

 

Please help me :(... Thx

2 REPLIES 2
Highlighted
Community Hero

Re: XML Parse - document load and parse from local disk

Hi,

 

> it does not work for me.. 

But works for me. And even in more than one project.

Any chance for more detailed info? Like you do when you report a problem to your developers?

What have you tried? What exactly does not work? What is the error? At what line of code? What is the additional information from the test log's Additional Info pane? Should I guess about the content of your ParseXML() function?

 

P.S. Have you read for details the referenced help article? It contains an example of how to load XML file...

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Community Manager

Re: XML Parse - document load and parse from local disk

Hi @David91,

Was this question resolved? If you still need a solution, could you please clarify what you mean by "it does not work for me"? If you get any error, please post it here.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors