Skip to content

Verify Validity of all locators

This article is a part of the Self-paced Learning Series for the Course: First-Hand Experience of Worksoft SaaS.

Please refer to the link for more details on the Course.
 
 Mapping the Worksoft SaaS feature to the Course Context :: Lesson 14:: Topic 2


1. Failed locator pop-up
In our case, the locator type 'id' failed to identify the element in the AUT. This is probably because the id is modified as part of the latest release in this environment, hence it's become invalid now.

When I hover on the failed locator popup, the id locator for the age element failed, however, the next locator in sequence, which is the name locator is valid and there was no need to check or use the remaining locators. 


2. Verify Validity of all locators
As discussed that we can use Verify Validity of all locators before/after the Test Execution. In our case, we have already executed our test, which means the validation of locators has already happened. Hence, when you switch to the 'Design & Build' tab of the respective Test Script, the Target field will show an 'attention' icon and when we expand the instruction, we see that 'Verify validity of locators' icon is in Red.


3. Practice
  1. In the 'Execute & Debug' do a mouse over on the red icon in the Target field of the first instruction
  2. You will see that the first locator is shown in red indicating that the locator has failed to identify any element in the application user interface and all other locators in green with the single having count of 1 indicating that element is located using this locator
  3. Click on 'Design & Build' tab in the window
  4. Go to the instruction with an '!' icon. Mouse over to see the message 'One or more locators included in the target of this test instructions is (are) invalid. Such invalid locators may result in failed test execution outcomes for some or all testing platforms.'
  5. Expand the instruction by performing double click anywhere in the instruction row
  6. Click on the 'Verify Validity of all Locators' icon (the last icon beside the Target field in the expanded view)
  7. You will see a popover 'Select validation type' with the fourth option 'Identify all of the above' selected. Retain it and click on 'Ok'
  8. You will now see that the 'Target' field is auto-expanded and an emoji icon is displayed for each of the locators.
  9. Mouse hover on each of the emoji icons to read and understand the message:                          9.1. Wherever the locators are visually identified by the emoji in red, that indicates that the locators that can't individually match any element (visible/hidden) on the UI)                          9.2. Wherever the locators are visually identified by the sad emoji in yellow with a blind eye icon, that indicates that the same locator also found hidden elements mapped to it.                  9.3. Wherever the locators are visually identified by the sad emoji in yellow with the count of the elements mapped to the locator, that indicates that there are multiple elements both hidden and visible mapped to it.

Feedback and Knowledge Base