Search code examples
jsonapijmeterresponse

Jmeter Extracting Json response with contains and not included condition


I would like to ask for your assistance regarding this scenario below because I want to extract all values version without RC txt. Your response is highly appreciated. Thank you

Sample Response [{ "version": "2-325" }, { "version": "2-327RC2565" }, { "version": "2-326" }, { "version": "2-327RC256" }]

I want to combine contains and not included syntax however I'm getting an error

Expected Result: Only Values will be extracted 2-325 & 2-326

**Note the version content is dynamic.

Image


Solution

  • You could try looking for the version attributes which don't contain RC, it could be done using a regular expression with negative lookahead.

    An example one:

    $..[?(@.version =~ /((?!RC).)*/)]
    

    Demo:

    enter image description here

    More information: JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios