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.
-
@iOSFindBy(xpath = “//UIAApplication”) @iOSFindBy(xpath = “//UIAButton”) //Failing
-
@iOSFindBys({@iOSBy(xpath = “//UIAApplication”), @iOSBy(xpath = “//UIAButton[@label=‘Login’]”)}) //Failing
-
@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.