I have a JSON request which sends 200 OK response even when response body is not correct. I want to capture "wrongdata" value only from incorrect response bodies and display them in log or results file.
How can I do this.
Tried adding a JSON extractor and stored the value in as "myVariable". enter image description here
Then added a JSR223 PostProcessor with the below code: enter image description here
Looks like JSR223 postprocessor is not executing
The simplest way to achieve the requirement is
Enable the text check for the request
Add simple data writer listener to the test plan and provide a file location path to write the data. Then enable errors only option in it. Then click configure button -> check all the required data needs to logger when failure
Later, You can view the file using view results tree listener or via editor (if you are comfortable)