When using Locator and Web Automation, it is crucial to have a good grasp of the various attributes that Clicknium employs to locate web elements. These attributes include “tag,” “id,” “name,” and others.
Sometimes, web elements may have additional attributes that are equally important and can be utilized to identify the web page. Therefore, if the locator validation fails after running the script, it is helpful to modify some of these significant attributes to replace the first locator attribute that was captured. This is a common scenario that we can go through together, and I can provide an example to help you better understand it.
2. Version Requirement #
To take advantage of this functionality, you’ll need to have the following installed:
Note: For more about the installation and the tutorial of Clicknium Automation, please refer to here.
3. Samples #
The example below demonstrates how to take advantage of this functionality.
It is simple to generate the locator like the one below using Clicknium Recorder , however in this scenario, the “ancestorId” of the produced locator is dynamic; if you create a work item again, the “ancestorId” will be change.
Given that Clicknium returns the values for all of the web element’s attributes, choosing “aria-label” and excluding “ancestorId” will make the locator more dependable for this sample.