Sorry, I am not aware of any OOTB filter, assertion, or step for sorting data in JSON arrays.
Some options are:
- Use live recording to capture the responses exactly as they are sent from the live system
- Externalize the array into a DBMS, use a query to retrieve & sort the data, dynamically insert the array into the response object
- Implement a script (JSR step or scripted assertion) to access the response JSON array and sort the results (e.g., Google GSON API)
- Sort the arrays in the rsp.txt file before running the R/R pair recorder
I suppose it is possible to create a custom step that could sort the array. However, from a product perspective, identifying the elements to sort, which elements to exclude, and the element keys considered on the sort could create a lot of complexity. For example, does the script sort every element in the JSON (squad, team name, players, cache, provider, creditLeft, etc.), only team name, or a subset within the hierarchy (team name and players). By which key element does the logic sort, pid or name, and is the sort sequence ascending, descending, or a combination of both (i.e., sort teams in descending order, but player names within the team in ascending order)