Search code examples
jmeter

Ignoring errors in JMeter


I want JMeter ignore an error. That request error is expected and is part of our session initiation protocol. Can't find a way to hide that error from be displayed on stats etc.

In other words: One of my SOAP samplers return an error (401, authentication thing) and that is expected. That is request error, yes, but not an error to report really.

Is that possible in JMeter to hide such errors somehow and/or exclude them from the test result?


Solution

  • Two options:

    1. Reconfigure where you've placed your Listeners, so the request is effectively omitted from results.

    2. Use a BeanShell PostProcessor to write a short beanshell script to change the status from "fail" to "pass" if the code is 401.

    if (prev.getResponseCode() == "401") { 
        prev.setResponseOK(); 
    }
    

    picture illustration of option2