derekwrobel
13 years agoNew Contributor
DataSink - possible to save/output multiple xpath nodes?
As part of my tests, in addition to performing asserts, I also output specific xpath nodes of the response messages into the Excel document used as a DataSource. This way, in the excel document, anyone else can quickly see what the expected response message is, and what the actual was.
However, I need to extract multiple nodes because of the structure of our response:
<Resposne>
<Message>
<string>Response 1</string>
<string>Response 2</string>
<string>Response 3</string>
</Message>
</Response>
I've tried several different ways to grab all <string> tags but it seems DataSink will only grab the first one it finds:
//Message/*/text()
//string/text()
Not sure what I need to do to include all strings when using DataSink to export the values to Excel. Anyone have any ideas? The problem is that I do not always get a response with 3 strings. It can be anywhere from 1-5 (possibly more).
However, I need to extract multiple nodes because of the structure of our response:
<Resposne>
<Message>
<string>Response 1</string>
<string>Response 2</string>
<string>Response 3</string>
</Message>
</Response>
I've tried several different ways to grab all <string> tags but it seems DataSink will only grab the first one it finds:
//Message/*/text()
//string/text()
Not sure what I need to do to include all strings when using DataSink to export the values to Excel. Anyone have any ideas? The problem is that I do not always get a response with 3 strings. It can be anywhere from 1-5 (possibly more).