XML Testing

While testing XML file, what are the areas we do consider?

Questions by vk1978   answers by vk1978

Showing Answers 1 - 4 of 4 Answers

goksn

  • Jul 22nd, 2009
 

XML testing is more of white box. Only developers and white box testers have more command in testing xml files.

But as a black box tester, we can find

IF AUT is purely web, then we can check the compatibility of xml related data in different browsers, operating systems (see how xml interacts with CSS etc)

XML is obeying DTD of the xml.

XML is well formatted.

  Was this answer useful?  Yes

XML Testing

Hi Apabbati,

XML testing can be under 2 scenarios.
1) Validating the Structure of XML.
2) Comparing Nodes and Properties.
3) Comparing XML file against a Standard XML format to find differences.

Validating the Structure of XML.

Sometimes the AUT would return result-sets in XML formats. Meaning as an output of any operation carried out in the application, an XML file could be generated.
As part of testing we would need to validate the Structure of the XML in terms of Parent - Children nodes. We would also need to ascertain Node properties and Attributes.

Comparing Nodes and Properties.

Testing scope in this would involve extracting Specified Nodes and their Attribute values and checking whether valid data was actually posted in these.

Comparing XML file against a Standard XML format to find differences.

In the above scenario, XML files from 2 environments would be compared. It should not be a textual comparison, as it would be ineffective. It would be Node based comparison where Every Parent node would be compared in terms of Child Nodes, attributes etc.
Overall structure of both XML's would be compared.

Testing Methodology.

XML testing could be carried out manually in case the number of XML results / files is very less. Say 1 or 2 but comparing larger number of XML files would be difficult.

We generally use automated code to perform the same. We could use something on following lines. Please NOTE this is a sample code only.

set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("C:Google.xml")

for each x in xmlDoc.documentElement.childNodes
msgbox(x.nodename) & ":" & (x.text)
next

The above code would iterate through the XML file and return all asoociated ChildNode names.

Cheers...

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions