I am reading in an XML file that contains a set of test results that looks as follows:
<?xml version="1.0"?>
<testsuite>
<build>
<run>
<test>
<index>1</index>
<id>1</id>
<description>Description 1</description>
<result>Pass</result>
</test>
<test>
<index>2</index>
<id>2</id>
<description>Description 2</description>
<result>Aborted</result>
</test>
<test>
<index>3</index>
<id>3</id>
<description>Description 3</description>
<result>Dependency</result>
</test>
<test>
<index>4</index>
<id>4</id>
<description>Description 4</description>
<result>Failed</result>
</test>
</run>
</build>
</testsuite>
I can succesfully get the nodes listed by using the following:
strQuery = "/testsuite/build/run/test/ (id|result)"
Set nodeslist = xmlDoc.selectNodes(strQuery)
And I know to use a for each loop to grab the node values...
For Each objNode In nodeslist
'WHAT TO DO IN HERE...
Next
However, I am now stuck at the point where I need to use the id and its associated result. Essentially I will take this information and upload the result to a test system but at the moment I am stuck on how to loop through the 4 separate test nodes and pick out the id and result for each one, ensuring that they remain linked to each other i.e. if they were to be assigned to variables such as ID and RESULT which I could then perform my upload action on before looping back around and re-assigning them to the values within the next test node.
Any help much appreciated.