Hi all,
I have an issue with PageObject fields for iOS. Back button on NavBar has different ID’s on different screens in our application under test, so I declared it this way:
@HowToUseLocators(androidAutomation = LocatorGroupStrategy.ALL_POSSIBLE,
iOSXCUITAutomation = LocatorGroupStrategy.ALL_POSSIBLE)
@AndroidFindBy(xpath = "//android.widget.ImageButton[@content-desc='Navigate up']")
@AndroidFindBy(xpath = "//android.widget.ImageButton[@content-desc='Collapse']")
@iOSFindBy(accessibility = "Back")
@iOSFindBy(accessibility = "back icon")
public MobileElement btnBack;
However, the element cannot be found. The exception I get reads the following:
Can't locate an element by this strategy: Locator map:
- native content: "By.chained({By.AccessibilityId: Back,By.AccessibilityId: back icon})"
- html content: "by id or name "btnBack""
Should it really be By.chained there? I thought it had to be By.all or something similar.
Element can be found is either of these locators is used separately without LocatorGroupStrategy specified.
For Android it works without any issues.
Java client version is 5.0.1.