79301831

Date: 2024-12-22 22:29:10
Score: 0.5
Natty:
Report link

To extract ids where "isFolder": false, use:

Python with jsonpath-ng:

from jsonpath_ng.ext import parse

# JSON response
json_response = {
    "data": {
        "tileGrid": {
            "items": [
                {"isFolder": True, "id": "123456"},
                {"isFolder": False, "id": "6789192"}
            ]
        }
    }
}

jsonpath_expr = parse("$.data.tileGrid.items[?(@.isFolder == false)].id")
ids = [match.value for match in jsonpath_expr.find(json_response)]
print(ids)  # Output: ['6789192']

JMeter JSON Extractor: JSONPath: $.data.tileGrid.items[?(@.isFolder == false)].id Match No.: -1 (for all matches) Variable: nonFolderIds This will extract 6789192. Debug to confirm variable values. Make sure to test pass valid JSON. use any available tools to validate JSON data.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Rehana Parveen