XML validation

Experiences, small talk, and other automation gossip.
Posts: 27
Joined: Mon Jan 13, 2014 3:45 pm

XML validation

Post by rholdberh » Wed Jul 23, 2014 3:03 pm

i need some help. My application is generating XML after some wizard. And i need to verify that all values were correctly written to this XML. As i understand i can do this in 2 ways:
1. While test is running create my own XML and then just compare "my" and "application" XMLs
2. Just parse XML and verify that all strings are correct

IMHO: First option is quite "dirty" solution, i dont think that it is a good idea to create 1 XML during test and then compare it with one that was created by application. Second option will not verify all the XML, but only nessesary values aand this is not also very good from the test side. So maybe you can give me some positive arguments for this or maybe better solution.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: XML validation

Post by Support Team » Mon Jul 28, 2014 2:15 pm

Hi rholdberh,

I think I would also prefer the second solution. You can use, for example the XmlReaderof the .NET Framework in order to check if the correct values were written into the xml file.