0

Below is the response code:

{
 "responseCode":600,
 "message":"Levels",
 "responseObject":
  [
   {
   "createdBy":1,
  "hierarchyText":"COUNTRY",
   "level":1
  },
 {
  "createdBy":1,
 "hierarchyText":"REGION",
   "level":2
  },
  ]
}

My regular expression is : $.responseObject.createdBy[*].hierarchyText[1] but it's failed in jmeter saying text not found. Null value fetched.

enter image description here

David Ansermot
  • 6,052
  • 8
  • 47
  • 82

2 Answers2

0

please give proper json . the json provided might be typo mistake or invalid please cross check by using this online tool http://jsonpath.com/ also cross check the given json path is correct or not. if you are able to get you json path worked here, in jmeter also it works ultimately.

use the below blog to find proper jsonpath in your case

https://www.blazemeter.com/blog/advanced-usage-json-path-extractor-jmeter

I tried this case in the above online tool , i found json is invalid .

hope this helps

Suman g
  • 477
  • 3
  • 14
0

I guess you want to extract REGION. If yes:

  1. You need to provide result variable name.
  2. You should modify JSON Path expression like:

    $.responseObject[1].hierarchyText
    

Also be aware of Debug Sampler and View Results Tree listener combination - it will allow to see the values of all JMeter Variables as well as JMeter and System Properties. See How to Debug your Apache JMeter Script article for more details on troubleshooting JMeter test scripts.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133