Using Page Object Pattern and its annotations to find a particular element, however this element has different possibilities, I tried to use all the locator strategies explained in this page:
The problem with (ALL_POSSIBLE) strategy is that it will get all the result of all strategies that apply, for example:
@HowToUseLocators(androidAutomation = LocatorGroupStrategy.ALL_POSSIBLE)
@AndroidFindBy(xpath = “strategy1”, priority=0)
@AndroidFindBy(xpath = “strategy2”, priority=1)
@AndroidFindBy(xpath = “strategy3”, priority=2)
@AndroidFindBy(xpath = “strategy4”, priority=3)
List elements;
It might return a list of elements that apply for 2 of the above strategies while i presumed that it will only return the result of the first successful strategy according to the defined priority.
Is there a workaround for this?
Thanks in advance.