If the api failing with connection timeout/Socket timeout , how to ignore from listener(Aggregate report) in Jmere/Blazemeter?

20 Views Asked by At

Currently we are using below code to ignore those issues but transactions/hits is appearing in listener.

if (sampleResult.getResponseCode().equals("Non HTTP response code: org.apache.http.conn.ConnectTimeoutException") || sampleResult.getResponseCode().equals("Non HTTP response code: java.net.SocketTimeoutException")) {
    sampleResult.setSuccessful(true); 
}

if api fails with connection timeout/Socket timeout , the hits should exclude from listener (Aggregate/summary report) in Jmeter & Blazemeter.

1

There are 1 best solutions below

3
yazhdevi subramani On

Answer: Below code is working as expected:

def ResponseCode =prev.getResponseCode();
if (ResponseCode == "Non HTTP response code: org.apache.http.conn.ConnectTimeoutException" || ResponseCode == "Non HTTP response code: java.net.SocketTimeoutException") {
   prev.setIgnore()
}