Why are HTTP 200 OK Responses Counted as Errors?


Performance Tests with a 200 response code are marked as failed in your Errors report.


This is not a mistake.

How JMeter calculates whether a response is an error or not 

BlazeMeter saves the Sample.jtl files in an XML format, as this is the correct way to store successful HTTP requests. 

To better acquaint yourselves, here are a few examples of some 200 OK HTTP samples taken from a BlazeMeter sample.jtl file:

A Successful HTTP 200 OK HTTP Request

<sample t="2389" lt="337" ts="1385384058184" s="true" lb="demo.blazemeter.com" 
rc="200" rm="OK" tn="Tour 1-2" dt="text" by="114" sc="1" ec="0" ng="6" na="6" 
hn="ip-10-116-219-48" in=""> 
    <name>Duration Assertion</name>   

Notice the “s=true” which is means its successful (the s=true flag, followed by the rc=200 assures us that the entire HTTP request was successfully completed).

Above, you can also see an assertion to this HTTP request which did not fail.

Assertion Errors

Now, lets look at this HTTP request which is also a 200 OK:

<sample t="3040" lt="332" ts="1385384066792" s="false" lb="Resources" 
rc="200" rm="OK" tn="Tour 1-3" dt="text" by="114" sc="1" ec="1" ng="23" 
na="23" hn="ip-10-116-219-48" in=""> 
    <name>Duration Assertion</name>
    <failureMessage>The operation lasted too long: It took 3,040 milliseconds, 
    but should not have lasted longer than 3,000 milliseconds.</failureMessage> 

You can see that the response is still 200 OK but, we had an assertion which failed the response and you can also see the description or failure message of the assertion.

A common scenario for these types of errors is a failed login, because although the request was processed successfully (that's why we got 200 OK) the credentials were false, and that's why the assertion failed the request.

Another scenario is a “Duration Assertion”. If we won’t accept a response time over 5s of a certain page, then we should apply a “Duration Assertion” to fail the request.

Embedded Errors

Let’s look at this HTTP request:

<httpSample t="2674" lt="171" ts="1385391325519" s="false" 
 lb="demo.blazemeter.com" rc="200" rm="OK" tn="demo.blazemeter.com 1-12" 
 dt="text" by="336853" ng="50" na="50"> 
    <name>Duration Assertion</name>
  <httpSample t="343" lt="171" ts="1385391325519" s="true" 
   lb="http://demo.blazemeter.com/" rc="200" rm="OK" tn="demo.blazemeter.com 1-12"  
   dt="text" by="29146" ng="0" na="0"/>…
  <httpSample t="159" lt="159" ts="1385391326193" s="false" 
   rc="404" rm="Not Found" tn="demo.blazemeter.com 1-12" 
   dt="text" by="649" ng="0" na="0"/>…


We can see it’s a 200 OK (rc=200), there are no assertions, but, the successful flag is still false (s=false). This means that JMeter was unable to retrieve one of the embedded resources (such as pictures, JavaScripts, CSS etc.) and marked the request as unsuccessful.

In this example, JMeter could not retrieve the jquery.js element and got 404 for it.

How do I view my test’s sample.jtl file ?

Download the ZIP of your test and extract it.