In test automation, an "Element" refers to a user interface (UI) field or control on the webpage that your test logic aims to interact with or verify.
For web applications, ACCELQ provides two distinct methods for Element identification:
- Locator-Free
- Smart Locator
Locator-Free
As implied by its name, this method of element identification eliminates the need for you to create or manage a Locator. ACCELQ employs an AI-powered algorithm to detect functionally significant screen information related to the Element of interest. Within your test logic, you simply use a textual hint provided by the system to represent the Element for interaction. This process requires no explicit saving or management of the Element.
For instance, in the statement below, "qbankadmin" is input into a field labeled (hinted) as "Username":
This method, termed 'Locator-Free', may utilize hints not always visible on the screen. These hints are easily identified by hovering over the element in the recorder and waiting a few seconds. When you are recording logic from the Recorder, system automatically prefills the element hint in the statement that is generated.
Adopting this approach enhances the resilience of your test logic against changes in the application's Document Object Model (DOM) structure and HTML code, ensuring your logic remains functional without dependency on the front-end code specifics.
As the locator text for an element is directly incorporated into the Action logic statement, there is no need for explicit or separate management of the element. These elements do not appear in the Element Repository.
Learn more about Locator-free automation.
Smart Locator
The Smart Locator method involves explicitly maintaining an element within the Element Repository, with identification criteria based on the element's DOM structure. It utilizes a sophisticated strategy to generate a unique ID for an element, using a stable combination of HTML attributes.
With Smart Locators, each Element is assigned a logical name used within your Action logic statements. These Elements are cataloged in the Element Repository.
For example, in the statement below, "qbankadmin" is entered into an input field referred to as "Username Web Input" which is stored in the Element Repository.
Although this method depends on the HTML structure, ACCELQ's intelligent selection of a stable attribute set ensures reliability across application updates.
Learn more about Smart Locators.
Managing default Locator Option for logic development
By default, ACCELQ opts for the Locator-Free method when generating statements, either via the Recorder or within the Logic Editor, whenever possible.
This default behavior can be adjusted in the Resources > Project Preferences section.
- If the Locator-Free method does not yield a meaningful or reliable hint, the system automatically defaults to the Smart Locator option, regardless of the preset preferences.
- Additionally, if the system assesses that the Locator-Free hint might require the user's review for label clarity, it offers the choice to evaluate and select between the Locator-Free and Smart Locator options, independent of the Project Preferences settings.
Manually selecting the Locator Option
When recording or adding a statement, you can manually choose between the two locator options for element identification, regardless of the setting in the Project Preferences. This is done by clicking the [L/O] tag next to the command name in the Recorder or within the logic editor command search results for a specific command.
Comments
0 comments
Please sign in to leave a comment.