Extract data from JDBC step
I have some confuse with Ready API. Could anyone help?
Here is the response data from JDBC step:
<Results>
<ResultSet fetchSize="0">
<Row rowNumber="1">
<DESCRIPTION>auto1</DESCRIPTION>
</Row>
<Row rowNumber="2">
<DESCRIPTION>auto2</DESCRIPTION>
</Row>
<Row rowNumber="3">
<DESCRIPTION>auto3</DESCRIPTION>
</Row>
</ResultSet>
</Results>
In the Xpath assertion, I use //DESCRIPTION then I got the result is an array.
But in another step, I want to use above response by using context.expand function:
context.expand('${JDBC#ResponseAsXml#//DESCRIPTION}')
==> the result is a String only, with value is 'auto1'
==> is there any bug here ? if not. could anyone help me to extract all data?
Many thanks and have a nice day!
I'm looking to do something similar. I'm not sure how to go about capturing the output but from what you are describing It sounds like you are capturing the data. I doubt if the data is in an array. It is most likely a list and the two are manipulated syntactically different.
Try adding subscripts to your xpath (0, 1, 2) and see if you can display each description in the response. If you can than I would think that a simple loop would allow yo to iterate through.
Maybe a piece to the puzzle!
You could use XQuery assertion like this
Or a script assertion to create a list array