Specifying the expected response code
Response code verification points verify that the response code matches an expected value. If the returned code is does not match, the test log reports a failed verdict event. You can specify an exact response code or verify that the code is within the same category.
About this task
- Change subsequent tests that you record. Click HTTP Return Code and click Relaxed or Exact. This changes subsequent tests that you record. , select
- Optionally, regenerate existing tests with the changed preference, as shown in Generating a new test from a recorded session.
Procedure
To set response code setting for a test:
- In the Test Navigator, browse to the test and double-click
it. The test opens.
- Right-click the test name, a test page, or a request, and
select Enable Response Code VPs.Your choice determines whether a verification point is added to every request in the test, to every request in a page, or to a particular request. The following figure shows a response code verification point within a test:Note: When you modify a test, the modified items appear in italic type. The italic type changes to regular type after you save the test.
- Click the verification point to display the response code editing fields in the Test Element Details area.
- To disable an individual response code verification point, clear the Enable verification point field.
- From the Select matching method list,
click an option to indicate how closely the returned response code
must match the recorded value.
Option Description Relaxed If the recorded response code is 200, 201, 202, 204, 206, 301, 302, or 304, then a returned response code of any of those values causes the verification point to pass. If the recorded response code is any other value, it is the same as if you had specified an exact match. Exact An error is reported if the returned response code does not match the recorded value.