0

I am completely new to JavaScript and I am struggling with XML request validation not sure to proceed further.

An XML file will get generated from application by clicking on the some button. The same content will be displayed in UI in one of the page.

I am automating my application using protractor using JavaScript.

Using JavaScript code I need to validate both the generated XML file data and UI data whether both are matching. (Mostly some node information's I need to validate as part of my comparison).

Please suggest me some approach or ideas to start my progress.

In all the blogs using DOM parser xml is fetched and used in HTML page.But here I have to compare the the xml with UI data.

halfer
  • 19,824
  • 17
  • 99
  • 186
User0707
  • 3
  • 1
  • 2
  • 1
    Find an XML parser to be able to get data from the downloaded XML file, for example https://www.npmjs.com/package/xml2js. Using Protractor you identify the UI data that was added to the XML, and using xml2js you can fetch data from that file and compare it with the UI data. – return Oct 23 '19 at 07:40
  • compare to convert entire xml to javascript object, you can use https://www.npmjs.com/package/xpath.js to query xml. – yong Oct 24 '19 at 12:22

0 Answers0