I got the response like the following:
<response>
<status code='200' server_time='xxx' />
<tests>
<test id='1' name='a!' status='Started' />
<test id='2' name='bb!' status='New' />
<test id='3' name='ccc!' status='New' />
<test id='4' name='dddd!' status='New' />
</tests>
</response>
I have already added a Xpath extractor into the sampler:
Reference name: mytest
XPath Query: //test[@id='1']
But the return variable (mytest) is wrong.
OUT.println(mytest) --> void
I'm a newbie with JMeter. What can I do to solve this?
Obviously the
println()function prints the string value of thetestelement, and in the provided XML documenttestelements do not have any content and their string value is the empty string.You want:
and
The former selects all
nameattributes of alltestgrandchildren of the top element of the document, that have anidattribute with value1.The latter selects all
statusattributes of alltestgrandchildren of the top element of the document, that have anidattribute with value1.