Hello can someone help me simulate this scenario. Because I want to use contains or Partial text on my filter using JMESPath extractor on Jmeter.
Sample Response:
[{ "orgName": "MNL_Automation", "name": "Test-123", "agentMap": { "25b08b79-d2e6-3313-bf39-8d1a8bf318d5": "DATABASE", "9af282a5-1d13-3050-8912-ab29275f215d": "BUSHIDO APPLIANCE", "4013a43f-0ea2-3df0-8fc3-9e562a7f82c7": "APACHE TOMCAT", "a51df66c-7b0d-30b8-85db-03605246aecf": "AD SERVER" } }, { "orgName": "MNL_Automation", "name": "Test-132", "agentMap": { "25b08b79-d2e6-3313-bf39-8d1a8bf318d5": "DATABASE2", "9af282a5-1d13-3050-8912-ab29275f215d": "Testing APPLIANCE", "4013a43f-0ea2-3df0-8fc3-9e562a7f82c7": "APACHE TOMCAT", "a51df66c-7b0d-30b8-85db-03605246aecf": "AD UAT" } }, { "orgName": "DEPARTMENT 2", "name": "BUSHIDO", "teams": "{"APPLICATION_ADMIN":"30084152-5ddc-3079-a765-dbbcd58f2391"}", "agentMap": { "c1716dcd-5181-3e9e-ac05-0e0cc48b0789": "AD SERVER" } } ]
Response Screenshot:
Expected Result: Will Extract all agentMap values with the name starts with Test
Currently I'm just using exact filter but it returns me single filter and I want to use Partial text/Contains to make my the script more flexible. Your response is highly appreciated. Thank you so much
Not sure whether it's possible to achieve with JSON JMESPath Extractor as JMeter's implementation doesn't strictly follow the JMESPath specification, however it should be possible to get it with JSON Extractor, the relevant JsonPath query would be something like:
$..[?(@.name =~ /Test.*/)]
Demo:
More information: JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios