Validate

Let’s talk about how to validate a locator.

1. Starting validation #

To start validating, go to the locator viewer tab in Visual Studio Code and click on “validate”.

2. Locator validation #

2.1 Single locator #

Once you click on “validate”, you will get a validation result. If you need to refer to this result, please see the section on ” Validation result ” below.

2.2 Single locator with variables

If you have a single locator with variables, you can still validate it by following these steps:

  1. Capture the locator and modify it with variables. For more information on variables, please refer to the ” Parametric Locator” section.
  2. Click on “validate”. A pop-up window will appear.
  3. Input the value of the variable and click on “continue”.
  4. Refer to the “Validation result” section for the validation result.
Click on “validate”. A pop-up window will appear.
click the button Continue

2.3 Single locator with multiple windows #

If you have a single locator that can be found in multiple windows, you can validate it by following these steps:

  1. Click on “validate”. A pop-up window will appear.
  2. Select the correct window by choosing the index of the window and click on “continue”.
  3. Refer to the “Validation result” section for the validation result.
choose the index of the window

2.4 Multiple similar locators #

If you have multiple similar locators, you can validate them by following these steps:

  1. Capture the locator and modify it with a wildcard.
  2. Select the index of the element and click on “OK”.
  3. Refer to the “Validation result” section for the validation result.
locator with a wildcard
Select the index of the element

3. Validation result #

If validation is successful, the UI element will be highlighted, and the locator viewer tab in Visual Studio Code will display the correct information as below:

If validation fails, the locator viewer tab in Visual Studio Code will display the error message as below:

What are your feelings
Updated on 27 November 2023