1. Assertions - HTTP Response Verification & Actions on Failure
- 1 Introduction to Response Verification
- 1.1.1 Default View: Waterfall
- 1.1.2 The Response Verification View
- 1.1.3 The Response Verification Options
- 1.1.4 Verify Content
- 1.1.4.1 Verify By Size
- 1.1.5 Verify Content
- 1.1.5.1 Verify By Text
- 1.1.6 Failure Action
- 1.1.7 Reset Settings
- 1.2 Text Operations
- 1.2.1 Search Text Examples
Introduction to Response Verification
Avoid executing tests without controlling the received content of URL calls by comparing them to the originally recorded data.
Many errors from Web server applications are embedded inside valid HTTP 200 responses. Therefore, the content of the responses must be also be checked to detect content errors under load.
For this reason, ZebraTester examines the content of all recorded URL calls and automatically applies a content check per each URL call using a heuristic algorithm. This algorithm performs content checks by searching for an ASCII-text string inside the received content; however, if this seems impossible, or if this doesn't seem to make sense, the received content is checked by its size (content length) instead of by searching an ASCII-text string.
So you can use one (or more) variables from the Var Handler as part of a test-string on the URL using the Response Verification view.
Icon/View | Screenshot |
---|---|
Default View: WaterfallThere will be two alternate views of the recorded data; the default is a waterfall view of the URL Calls, with the specific recorded information for each row. |
The other is the Alternate Response Verification View that will test the responses against the parameters you set. An eye icon-toggle, found in the upper right, indicates if you are in the waterfall view (grey eye) or the response Verification View (green eye). If you are in the waterfall view (Above), click the grey eye icon to access the “Alter View,” which is short for the Alternate Response Verification View. |
The Response Verification ViewThis will produce a view with a rightmost column titled: “Response Verification.” In this view, look for the magnifier icon on each line that will open the HTTP Response Verification & Failure Action Dialog. Close-up view of hovering over the magnifier icon. Notice each line has its own icon: | |
HTTP Response Verification & failure Action After clicking the magnifier icon, this dialog will set what parameters and thresholds to verify/fail a returned response. Note that you can set this for one URL or all URLs that match a specific content type. |
The Response Verification OptionsYou select certain responses and then use them as verifications (with the above options) that will be recalled (and applied) when generating the load test program execution. All response verification modifications are stored together with the recorded web surfing session and reapplied if the web surfing session is reloaded. During the execution of a load test program, the HTTP response code and the received MIME type of each URL call are always compared with the originally-recorded response from the web surfing session (if not disabled manually). The response verification menu allows the specification of how received content is to be tested: | |
Verify HTTP Status Code | If enabled, the HTTP status code of the URL call is verified. Additionally, multiple alternative HTTP status codes can be selected, affecting these status codes as valid/successful URL status codes. Apica recommends keeping the default settings.
|
Verify Content-Type | If enabled, verify the received content type (MIME type) of the URL call. Instead of configuring a simple search text fragment, a text operation or a variable can also be configured. Apica recommends keeping the default settings.
|
Verify Header Text | If enabled, the configured text fragment is searched inside the received HTTP response header; an error is returned if this text fragment is not found.
|
Verify ContentIf enabled, verify the received content of the URL call. Verify By Size | This means that only the size of the content is verified. This is fast and a good approach for completely static content, like images. You may also set an acceptable deviation of 0% if the content never changes.
|
Verify ContentVerify By Text | Search for a text fragment inside the received content.
|
Max. Stored Content Size | By configuring a value other than unlimited, all response data are read as usual during the load test execution, but only a part is stored internally.
|
Failure Action | The Failure Action determines what happens in case the URL call fails.
|
Reset Settings | Reset the URL setting only or All URLs with a specific HTTP Status Code AND Content-Type. By clicking on the Apply Default Settings button at the bottom of the window, you can undo your changes, and the default settings are reapplied. |
Text Operations
Instead of searching the occurrence of a simple text fragment, the following Text Operations are also supported:
String | Description |
---|---|
| The search text must not occur inside the received content. |
| The search text must occur exactly <int> times inside the received content. |
| The search text must occur a minimum of <int> times inside the received content. |
| The search text must occur a minimum of |
Search Text Examples
Text | Description |
---|---|
| The search text "hello" must occur at least once inside the received content. |
| The search text "ORA-01652" must not occur inside the received content. |
| The search text "Dear Mr." must occur exactly one time inside the received content. |
| The search text "Order Number" must occur a minimum of one time and a maximum of two times inside the received content. |
| The search text "new order" must occur a minimum of three times inside the received content. |
Note: One or more variable text patterns in the form of ${<variable name>}
are supported as a part of the search text; for example, Welcome ${gender} {$name}
.
Can't find what you're looking for? Send an E-mail to support@apica.io