0

Hello i am using Jmeters JSONPath extractor, and the i am trying to extract certain fields from a response which is structured like the JSON below. I am trying to only extract the names of the child objects and not the details inside them, so something like:

Result[0]= key1
Result[1]= key2
Result[3]= key3 

Would I be able to do this using JSONPath extractor

{
   "output":{
      "key1":{
         "field1": "value1",
         "field2": "value2"
      },
      "key2":{
         "field1": "value1",
         "field2": "value2"
      },
      "key3":{
         "field1": "value1",
         "field2": "value2"
      }
   }
}
KurryF
  • 73
  • 1
  • 1
  • 5

1 Answers1

0

I don't think it's even possible with JSON Path Extractor, however it's very easy achievable with JSON JMESPath Extractor which provides keys function fully covering your use case, the relevant query is as simple as:

keys(output)

Demo:

enter image description here

More information: The JMeter JSON JMESPath Extractor and Assertion: A Guide

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