Adding a Verify step

You can use the Verify step to validate expected conditions during Web UI test run. The Verify step checks whether the application under test behaves as expected by comparing actual runtime values with expected values defined in the test. If the verification fails, the step is marked as failed in the test run results. After you add the Verify step from the General section of the catalog, you can choose the type of verification to perform by selecting a mode in the step details pane.

Before you begin

You must have completed the following tasks:
  • Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
  • Read and understood the information in Edit branch overview and Create or select an Edit branch.
  • Ensured that your project contains a Web UI test.

Procedure

  1. Click the Edit button displayed on the Test Editor page.

    The Edit button appears only when no active edit branch is selected.

    Alternatively, right-click the test in the test navigator panel and select Edit.

    The Edit branch dialog is displayed.
    If the Edit branch dialog is not displayed, then go to step 3.
  2. Select an existing edit branch or create a new edit branch.
  3. Drag and drop the Verify element under any test step as required from the General catalog in the Catalog tab.
  4. Click the Verify step.
    The step details pane is displayed.
  5. Select the required verification mode from the Mode list:
    • UI
    • General
    Note:
    The default mode depends on where the Verify step is added. When the Verify step is added within a With step, it opens in UI mode. When it is added outside a With step, it opens in General mode.

    A confirmation dialog is displayed, indicating that switching modes clears the current step configuration.

  6. Click Yes.
    Note:
    • The default mode depends on where the If step is added. When the If step is added within a With step, it opens in UI mode. When it is added outside a With step, it opens in General mode.
    • You can switch between the available modes by selecting a different option from the Mode list.
    • If you switch modes after configuring the step, select the required mode and then click Yes in the confirmation dialog. The existing configuration is cleared and the step opens in the selected mode.
  7. You can perform the actions that are listed in the following table to configure verification in a Verify step during a test run:
    Mode Action
    General: You can use General mode to verify variables, expressions, and business logic conditions during a test run. This mode validates runtime data instead of UI elements.
    Perform the following steps:
    1. Type or select a variable name in the first column.
    2. In the operator field, select an option to indicate the basis of comparison of the two operands.
      The available operators are as follows:
      • Equals
      • Not Equals
      • Greater Than
      • Greater Than Equals
      • Less Than
      • Less Than Equals
      • Strict Equals
      • Strict Not Equals
      • Includes
      • Not Includes
    3. In the third column, type or select the name of the variable to be compared with the value of the selected variable in the first column.

      Additionally, you can add, duplicate or delete rows for verification. Also, you can switch to the JS code view to create or modify the comparison statement.

    UI: You can use UI mode to verify UI elements and their properties in the application under test during a test run. This mode ensures that UI components are displayed correctly and match expected values.
    Perform the following steps:
    1. Select an object to be verified by dragging and dropping an element from Smartshot view, an element from Elements list, or a property-value pair from the Properties list.

      Alternatively, you can select an object to be verified from the list in UI Object, and then select an identifier such as Class, Content, Label, XPath, or Id of the object from the list. If you follow this method, you must ensure that the object is highlighted in the Smartshot view after you enter the values.

    2. Click click here to add a row to provide values to be verified under Verification Points.
    3. Enter the property name and value to be verified in the newly added row.
    4. Optional: Click the Click here to add relative to link, specify the relative location in the Location field, and specify the relative object in the UI Object field.
    5. Optional: Click the Click here to add alternative identifier link, and select a target object from the list in the Target 2 field.

      Alternatively, you can drag and drop an element from the Smartshot view.

    6. Optional: Select the Override Timeout checkbox in the Advanced tab and increase the timeout value in Duration for the object verification.
  8. Click the Save icon to save the modifications.

Results

You have added a Verify step to validate conditions in a Web UI test during a test run.

What to do next

You can run the test in Test Editor and view the Functional Report to verify the test steps with the variable assignment. See Running a Web UI test.