Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implicit check for uniqueness of locators #329

Open
tomg246 opened this issue Jun 19, 2023 · 1 comment
Open

implicit check for uniqueness of locators #329

tomg246 opened this issue Jun 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@tomg246
Copy link

tomg246 commented Jun 19, 2023

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

@tomg246 tomg246 added the enhancement New feature or request label Jun 19, 2023
@martingrossmann
Copy link
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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants