res object available inside the vars, assertions, scripting, and testing contexts can be invoked as a function to query nested response data.
Think of it as lodash.get() on steroids.
If you’re not familiar, lodash.get() is a utility function from the Lodash library that lets you safely access nested properties in JavaScript objects.
Response query filtering (including
[?] with filter functions and object predicates) works in both Safe Mode and Developer Mode.Examples
API
Standard dot notation
Example:Deep navigation with double dots
Example:Array indexing
Example:Array filtering with a filter function
Use[?] with a corresponding filter function to select matching items. [?] works with both standard dot notation and deep navigation (..).
Example:
Array filtering with an object predicate
Use[?] with an object to match items by property values. This is equivalent to i => i.id === 2 && i.amount === 20. [?] works with both standard dot notation and deep navigation (..).
Array mapping with a mapper function
Use[?] with a function that returns a transformed value to map over items. [?] works with both standard dot notation and deep navigation (..).
Example: