telekom / testerra

Testerra is an integrated framework for automating tests for (web) applications.
https://docs.testerra.io/
Apache License 2.0
27 stars 15 forks source link

implicit check for uniqueness of locators #329

Open tomg246 opened 1 year ago

tomg246 commented 1 year ago

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

martingrossmann commented 1 year ago

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