Verify or assert in your test

Validating expected values is important when you want to confirm that certain states are according to your expectations. For example, when you automate purchasing an item, you want to make sure that the name of the item reflects what you actually bought.

There are at least two ways to add a verify/assert statement to a scenario.

  1. Use context menu while recording.
  2. Add verify/assert commands from manual interface.

Use context menu while recording.

After recording a test case, right-click on the element that you want to verify then select the corresponding command:

  1. Record your test steps

  2. At the very last step, right-click on the element that you want to verify

  3. Click on Katalon Recorder (Selenium tests generator) on the context menu

Then you got a new verify command.

Add verify/assert commands from manual interface

You can also add a new verify statement manually.

1. Record your teps

2. Click on + button to add a new command

3. In the Command combobox, type "verify"

Then you got the autocomplete list of verify/assert commands.

4. Select the command that you are looking for, e.g. verifyText.

5. Click on the icon next to Target to select the element that you want to verify.

You got the result as the below screenshot. You can change the address to other options such as xpath or CSS Selectors.

6. Input the value that you want to verify.

You should click on Play button to execute the test to see your result.

Feedback