Assertions

Validate the correctness of an outcome

What is a test without an assertion?

Assertions are how we verify that the execution of a step gives an expected outcome. For example, if we are creating a test to test that a user can not log in with an incorrect username and password combination, we will assert that an error message incorrect username/password is displayed after clicking on the login button.

How to assert with Scandium

By clicking on the green checkmark (βœ…) on the Scandium toolbar, the assertion panel is displayed.

There are two broad categories of assertions you can make:

  1. Against the page itself

  2. Against an element on the page

Against the page

You can assert the value of the page title, the page url, or that the page contains a certain text.

Assert against an element on the page

You can also select any element on the page to assert against. When you opt to assert against an element on the page, the page is put into inspection mode such that any element you hover your mouse on is highlighted. You can click on any element to assert against it.

To assert against an element, on the assertions panel window, click on the big blue button:

Once the button is clicked on, the page is put into inspection mode, you can hover your mouse on any element on the page. You should see the element highlighted with a dotted border around it.

Click on the element you want to assert against. Then back on the assertion panel, from the list of commands, choose your desired assertion from the dropdown.

Currently, you can make the following element assertions:

Updating an assertion

If you added assertions during the recording of your test case, you can update the assertion type or expected value of the assertion from the step settings on your test editor.

Last updated