0

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 2

0

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(); 
        }
0
  1. Add Response Assertion as a child of the request you would like to mark as passed
  2. Tick Ignore Status box if you want to mark sampler as passed

    enter image description here


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')
}    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.