We are receiving a JSON response from a web service - which we can easily parse using JMeter when running tests. The problem that we recently found is that the fields in the JSON object are not always in the same order. Therefore, regex will break.
Here are the solutions we have tried:
1.) JSON path extractor (from jp@gc):
This is pretty cool and lets you choose the element that you want. The problem is that when there is a null value, it won't read it at all.
2.) Then we tried adding a BeanShell -pre-processor to set the variable to null initially, so that when it reaches the conditional it is executed properly. The problem with this approach is that once set to null, it won't change to anything if a value is picked by the JSON path extractor.
Does anyone have any ideas on other ways I could get this to work? Let me know if you have any questions or need clarification.