Reputation: 944
I try to read XML elements
in order to change the path of the HTTP Request
of the performance test.
My sample XML
data
<test>
<paths>
<path>/?test=test1</path>
<path>/?test=test2</path>
</paths>
</test>
Here is the path that I tried to read it through BeanShell
Sampler
Upvotes: 0
Views: 322
Reputation: 168082
I would recommend using XPath Extractor for parsing XML data.
Demo:
Example queries:
//path
- match both elements, you can use the output variables with ForEach Controller to hit all endpoints//path[1]
- matches only /?test=test1
//path[2]
- matches only /?test=test2
See XPath Tutorial for more information on XPath syntax
Upvotes: 1