I've been trying for a couple of days to get iOSFindBy & AndroidFindBy annotations working with page objects and the PageFactory. I've tried versions 2.2.0 and 3.0.0 of the java-client and tests for Android and iOS, all with the same result - which is the same as not including any annotations.
Here is a truncated version of one of my page objects
publicclassHomePhonePageextendsBaseHomePage {
publicHomePhonePage(AppiumDriverdriver) {
super(driver);
PageFactory.initElements(newAppiumFieldDecorator(driver,
IMPLICIT_WAIT,
TimeUnit.SECONDS),
this
);
}
@iOSFindBy(accessibility = "home_landing_my_favorites_count_label")
privateWebElementmyFavoritesCountLabel;
publicStringgetMyFavoritesCountLabel() {
returnmyFavoritesCountLabel.getText();
}
}My test code:
@TestpublicvoidtestHomeIsValid() {
homePhonePage = newHomePhonePage(driver);
globalNavPage = newGlobalNavigationPage(driver);
homePhonePage.clickHamburgerMenu(); //FAILS HERE because element was not foundglobalNavPage.clickHome();
}When I debug into PageFactory.initElements, I see [unknown locator] for each property that is a WebElement. Then the PageFactory defaults to looking for each page object's property name as the id or name of the WebElement and fails to find anything.

I suspect "I'm doing it wrong" but I can't figure out where. It is behaving as if the annotations are not even there.
I've been trying for a couple of days to get iOSFindBy & AndroidFindBy annotations working with page objects and the PageFactory. I've tried versions 2.2.0 and 3.0.0 of the java-client and tests for Android and iOS, all with the same result - which is the same as not including any annotations.
Here is a truncated version of one of my page objects
My test code:
When I debug into PageFactory.initElements, I see [unknown locator] for each property that is a WebElement. Then the PageFactory defaults to looking for each page object's property name as the id or name of the WebElement and fails to find anything.
I suspect "I'm doing it wrong" but I can't figure out where. It is behaving as if the annotations are not even there.