Lesson 7: Add verification points to test steps by using Smartshots

In this lesson, you will learn how to add verification points to the test steps by using the Smartshots to validate UI elements, values, and messages during a test run.

Before you begin

Ensure that you have completed the previous lessons in this tutorial.

About this task

In this task, you add a verification point to check whether the Create Login Details field is enabled. Verification points are evaluated when the test runs.

As each test step is performed, the following associated validations are verified:

  • If the validation condition is met, the test proceeds to the next step.

  • If the validation condition is not met, the step is marked as failed, and the failure is recorded in the test results.

Quick rules to remember

Use the following rules to choose the correct Verify action and verification point:
Table 1. Validation options
Validation requirement Recommended Verify action
Field value displayed on the screen Use the Verify action from the UI Catalog to validate values displayed in the UI.
Mandatory field or error message Use the Verify action from the UI Catalog to check UI-level validation messages.
Length or format validation (for example, 5-digit Employee ID) Use the Verify action from the General catalog to validate length and format rules.
Logical or data-based rules Use the Verify action from the General catalog to evaluate conditions or business logic.
Table 2. Common UI elements and verification points
Element type Verification point
Label text content
Input field value value
Field presence exist
Enabled or disabled state enabled

Procedure

  1. Locate the recorded step Create Login Details, and then click it.

    The step opens in the Smartshot view tab.

  2. Click the Expand view icon Expand view icon for smartshot to expand the Smartshot view for better visibility.
  3. Select the Create Login Details toggle field.
  4. Right-click and select Create user action for this element > Verify. This allows you to add a verification that checks a specific property of the selected UI element. In this scenario, this step creates a verification point to check whether the Create Login Details UI element is enabled.
  5. Select enabled:true option from the displayed Verification points list.
    You can view the created verification point in the Details tab.
  6. Select any UI element in Smartshot.
    Notice that once the UI element is selected, the same element is automatically highlighted in both the Elements panel and the Properties panel.
    • The Elements panel shows the UI elements captured in the recorded test.

    • The Properties panel displays the properties of the currently selected UI element.

    Additionally, you can use either panel to add the same Verify step.

    • From the Elements panel, right-click the highlighted UI element and select Create user action for this element > Verify. For example, Span Element in the Elements panel.

      You are creating a verification based on a specific property of the UI element, rather than the entire element.

    • From the Properties panel, right-click the tagName property and select Create user action with this property > Verify. For example, span.

      You are creating a verification based on a specific property of the UI element, rather than the entire element.

  7. Click Close to close the Smartshot.
    The Verify step is added to the recorded steps.
  8. Click Save to save the modified test.

Results

You have added verification points to the recorded Create Login Details step.

You have completed Lesson 7.

What to do next

In the next lesson, you will learn how to run the test. See Lesson 8.