Multiple variables in JSON path extractor

2,391 views
Skip to first unread message

abhi...@gmail.com

unread,
Oct 5, 2015, 11:31:58 AM10/5/15
to jmeter-plugins
Hi, I am trying to use the JSON path extractor and passing multiple variables to it.

- If I use a single variable, the result is fine, but passing multiple variables shows path not found error.

2015/10/05 21:01:15 WARN  - com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor: Extract failed com.jayway.jsonpath.PathNotFoundException: Extracted array is empty
at com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor.process(JSONPathExtractor.java:111)
at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:750)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:452)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:745)


I am passing the params separated with the ;  Can someone tell me if there is support for the same.

Regards,
Abhishek
Screen Shot 2015-10-05 at 9.02.16 PM.png

gli...@gmail.com

unread,
Oct 6, 2015, 1:40:40 AM10/6/15
to jmeter-plugins, abhi...@gmail.com
Hey Abhishek,

  1. Your JSONPath query is wrong, according to JSONPath Expressions chapter union operator is comma, not semicolon 
  2. Even if you correct it - it won't work due to https://code.google.com/p/json-path/issues/detail?id=27 issue
So I would recommend going for 2 separate JSONPath Extractors instead.  

gli...@gmail.com

unread,
Oct 6, 2015, 1:54:21 AM10/6/15
to jmeter-plugins, abhi...@gmail.com, gli...@gmail.com
Why? It will be basically the same as for what you're trying to do with union.

If you need this to be done in a single PostProcessor for some reason and you're familiar with programming (entry level) you can use JSR223 PostProcessor and groovy language to extract desired bits and assign them to JMeter Variables. 
Reply all
Reply to author
Forward
0 new messages