Expected HTTP Status Code is a new Web test request property that specifies the numeric HTTP status code that indicates success for the request. The value can be set on top level requests and explicitly added dependent requests. The primary purpose of the property is to ignore certain failures on dependent requests. By default, the recorder sets this value to 0, which means any 200 or 300 level return code is a success and any 400 or 500 level status is a failure.

 

Explicitly Added Dependents

Parsed dependent requests collection is generated at runtime. It is the result of parsing the response of the top level page request. An explicitly added Dependent request refers to a request added by right clicking on a top-level request and selecting “Add Dependent Request”.

 

If a dependent request is explicitly added to a request, that dependent will always be fetched according to the definition of the request. If the request fails, but matches the Expected HTTP code on the request definition, the dependent request will be marked as pass. For example, the value can be set to 404 if you expect that the request will not be found on the web server.

 

If a dependent request is explicitly added to a request, and Parse Dependents is set to true, and a matching request is parsed, the matching dependent request will not be submitted.

 

Redirects

For redirected requests, if the Follow Redirects property is set to true, the Expected HTTP Status Code works against the redirected URL.