Skip to content

implicit check for uniqueness of locators #329

@tomg246

Description

@tomg246

I would like to have all locators checked for uniqueness impicitly.
An exception are locators, that are used to create UiElementLists.
A property to enable/disable this seems reasonable

Activity

martingrossmann

martingrossmann commented on Jun 28, 2023

@martingrossmann
Contributor

Testerra already supports the element.unique() method to define that a UiElement should be unique. Otherwise an assertion error occures on the next UiElement action.
Of course, this is not usefull if you have a huge number of UiElements and want to be sure of uniquness of all elements.

We could introduce a strict mode for all checks which is handled in AbstractWebdriverCore.findWebElement(Consumer) in l.219.

A property could be tt.element.find.mode=selenium|strict

  • selenium (default) means that in case of non-unique locator the first appearance is used like Selenium does.
  • strict means the same like element.unique(), but for all UiElements (global)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @martingrossmann@tomg246

        Issue actions

          implicit check for uniqueness of locators · Issue #329 · telekom/testerra