I am capturing URl and path from s3URL from previous response. Some time S3URL not generated then URL and Path not found. In this case i want to hide error because it is application issue not scripting issue.
2 Answers
I tried with Adding Beanshell PostProcessor as a child of the request which must be successful and put the following code into "Script" area:
if (prev.getResponseCode() == "Non HTTP response code:java.net.URISyntaxException"){
prev.setResponseOK();
}
- Add Response Assertion as a child of the request you would like to mark as passed
Tick
Ignore Status
box if you want to mark sampler as passed
Alternatively you can amend the message using JSR223 Assertion and the following code:
if (prev.getResponseCode().equals('Non HTTP response code: java.net.URISyntaxException')) {
prev.setSuccessful(true)
prev.setResponseCode('Your custom response code')
prev.setResponseMessage('Your custom response message')
}