Assertions are used to verify the expected page content. It is needed to make sure that the requested page has loaded correctly. If an HTTP request completes successfully with HTTP OK code, it does not necessarily mean that the page contents have loaded successfully. For example, log in to a web application may fail and a failed login message may be displayed back. From an HTTP perspective, the page would be successful but from an application point of view, a page hit may be considered a failure. A successful login may be verified by checking the received page response. The presence or absence of a certain text string or text pattern may signify the success or failure of the page.

In the Assertions tab, you can apply assertions on the created transactions to verify the expected result with the actual result. You can also ensure that the requested page has loaded correctly.

Adding Assertion

To add an Assertion, you have the following fields to be filled:

Select the page(s)from the dropdown on which the assertion is to be applied.

Assert

The Assert dropdown list displays the following option. The fields are dynamic and depend upon the option selected from the dropdown list:

Let us discuss them in detail:

Content

On selecting Content, you will get the following options in the corresponding dropdown list:

After selecting the content to be checked, we need to choose how the user wants to search for the content.

For that we have the following option:

OR

Regular Expression: In the case of Regular expression, any special character in the text will be taken as Regular expression.

Ignore Case: Enable the checkbox to make the provided text non-case sensitive.

Complete response from a file

If you select Complete response from a file in Check, you have to choose the file in the file field.

Checksum

If you select Checksum in Assert, then you have to choose whether you want to check with Checksum or with Cookie.

Failure Condition

There are two failure conditions on the basis of which action will be taken:

Actions

Based on the above failure conditions following, you have the following action options:

Once the above failure and its action are selected, you have to type the failure message which can be seen when the failure condition is satisfied.

Save Occurrence count in Scratch Parameter: If you want to utilize assertion as a count parameter, then disable the checkbox for the failure condition and use the save count as a scratch parameter.

From the assertion list, the user can make changes to a particular assertion by clicking the edit  or delete icon as per the requirement.