1

I'm looking for an alternative to CSV as input data and I think xml is the right format for me. How could I make that work?

I feel I'm 70% there already with this answer. It stores the whole xml in a var 'content'. That's not what I need, but I would like to build on that example. I need the xml tags to be converted to a var, with its value (if any) as content.

What I need help with is: How can I convert every xml tag that was read, into an addressable jmeter var so I can use it as if I had read it using the CSV Data Set config element?

And I'll need to structure an xml containing all my testcases and their data in a way that make sense.

Example:

<testcases>
  <case>
    <name>tc1</name>
    <host>some.host.com</host>
    <command>uptime</command>
  </case>
</testcases>

1 Answers1

0

You can consider using __XPath() function which allows executing arbitrary XPath queries against files in the file system, you can use the function anywhere in your Test Plan.

Demo:

JMeter Xpath Function Demo

See Apache JMeter Functions - An Introduction article for more information on JMeter Function concept if needed.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks for pointing me towards this method. I'm trying to replicate your test, using a beanshell sampler (empty) with the XPath statements in the name. The logging shows that the node 'name' is found, but the value keeps being reported as `null`. I'm doing it wrong, obviously, but where am I going astray? –  Feb 06 '18 at 07:37