Appium PageFactory object initilization

I am bit confused on the way page object works as per https://github.com/appium/java-client/blob/master/docs/Page-objects.md

This is my xpath = “//UIAApplication//UIAButton[@label=‘Login’]” and it works properly if used directly. As part of trying out PageFactory model, I tried below combination for WebElement initialization.

  1. @iOSFindBy(xpath = “//UIAApplication”) @iOSFindBy(xpath = “//UIAButton”) //Failing

  2. @iOSFindBys({@iOSBy(xpath = “//UIAApplication”), @iOSBy(xpath = “//UIAButton[@label=‘Login’]”)}) //Failing

  3. @iOSFindAll({@iOSBy(xpath = “//UIAApplication”), @iOSBy(xpath = “//UIAButton[@label=‘Login’]”)}) //Working

Internally it is getting converted to

    • native content: “By.chained({By.xpath: //UIAApplication,By.xpath: //UIAButton[@label=‘Login’]})” //Failing
    • native content: “By.chained({By.chained({By.xpath: //UIAApplication,By.xpath: //UIAButton[@label=‘Login’]})})” //Failing @iOSFindBys
    • native content: “By.chained({By.all({By.xpath: //UIAApplication,By.xpath: //UIAButton[@label=‘Login’]})})” //Working @iOSFindAll

Can someone tell me what is the difference between all of these. Any help will be really appreciated.

Can some of the PageFactory / Appium experts comment on this