次のような一連のテスト結果を含む XML ファイルを読み込んでいます。
<?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>
以下を使用して、リストされたノードを正常に取得できます。
strQuery = "/testsuite/build/run/test/ (id|result)"
Set nodeslist = xmlDoc.selectNodes(strQuery)
そして、ノード値を取得するために for each ループを使用することを知っています...
For Each objNode In nodeslist
'WHAT TO DO IN HERE...
Next
ただし、IDとそれに関連する結果を使用する必要がある時点で立ち往生しています。基本的には、この情報を取得して結果をテスト システムにアップロードしますが、現時点では、4 つの個別のテスト ノードをループして、それぞれの ID と結果を取得し、それらが相互にリンクされていることを確認する方法に行き詰まっています。つまり、それらが ID や RESULT などの変数に割り当てられる場合は、ループに戻って次のテスト ノード内の値に再割り当てする前にアップロード アクションを実行できます。
どんな助けでも大歓迎です。