SmartLocator - Auto-correcting Object Details
Modern-day Web-applications usually have dynamic web elements. Consistency in the execution of test cases with these dynamic objects is the biggest challenge that modern day web applications face.
Qualitia's innovative approach of SmartLocator overcomes this challenge. With its advanced alternative, Qualitia encounters consistency in execution with dynamic object elements.
The SmartLocator feature tracks changes in object behavior and identifies objects with dynamic elements automatically and corrects the object locator values runtime during test case execution. This makes test case execution of web applications more reliable despite changes in object elements. These updated values are also added to the object repository for future use. This way, Qualitia never fails to identify objects even though object locator value is getting changed after every session.
Qualitia gives you complete control over where to use this feature as it can be enabled for every single object separately. This feature works only for desktop web object with dynamic elements which is added using Qualitia Object Spy.
Adding New Object in Qualitia
Internet Explorer
Qualitia automatically enables this feature while adding new objects using Qualitia Object Spy on Internet Explorer. You will see the SmartLocator feature on the right-hand side corner in the Object Spy window. Qualitia highly recommends to keep this feature enabled.Â
If you are an existing Qualitia user, click here.
Google Chrome
Starting v5.6, you can add objects from the application under test from Google Chrome browser as well. While adding objects using Google chrome extension, this option is enabled by default. You will see the SmartLocator option while editing this object.Â
Editing Existing Objects
While editing object details from the Objects screen of Qualitia Automation Studio, you need to select the SmartLocator checkbox.Â
Benefits of SmartLocator Feature
Let's take an example of https://in.yahoo.com/. On this web application, you will find few section names at the top of the window. Attribute values for these menus (Home, Mail, News and so forth) are dynamic. Add these objects in Qualitia under some test case and execute the click action on it. Â
Ensure you keep the SmartLocator feature enabled on the Object Spy window while adding these objects into the repository. Â
As these objects contain dynamic elements, locator values will be updated after starting a new session. During the test case execution, objects will get identified auto-correcting the locator values over existing values. You can view the existing and updated locator values analyzing Info Log from the test execution report.
Sometimes, it might happen that even after you enable this feature, object will not get identified. In this case, Qualitia gives proper error logs in the execution reports about object identification failure. You can relearn the object using Qualitia Object Spy.
In case the failure persists, you can edit the object, disable this option and add object locator type manually. Also, inform Qualitia support about the failure with appropriate logs.Â
Disabling this feature, object will no longer be eligible for SmartLocator identification.
If you wish to enable this feature for this object later, you will have to perform either of the following steps for SmartLocator to work for this object:
- Add the object again using Qualitia Object Spy.
- Specify a valid xpath manually for the object, it will be identified by SmartLocator only after the first execution.
Existing Qualitia Users
If you are an existing Qualitia user and you are having any web applications which have objects with dynamic elements, even you can use the SmartLocator feature. This will automatically modify the locator value at runtime and Qualitia will never fail to identify objects even though object locator value is dynamic.
After upgrading to Qualitia Automation Studio v5.6, you can enable this feature from the Object Spy window as mentioned in the screenshot below.
By default, the SmartLocator feature is disabled for all the pre-existing objects. It is not recommended to enable this feature for the parameterised objects. See /wiki/spaces/RES/pages/3367217812 for more information.