Validate expected values

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 verification statement to a scenario.

  1. Use context menu in a Recording session.
  2. Add a verification statement manually.

Use context menu in a Recording session

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 verification command.

Add verification statements manually

You can also add a new verification 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 verification 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