Question using the @FindBy annotation and driver.findelement

has anyone used the @FindBy? i have a really weird corner case in my platform. its been designed around the pageFactory and @FindBy, but sometimes i need to cast and IOS element to a Web element, pageFactory has issues doing it with certain ways its been setup…like mine. My fix which is kinda hacky is something like this…

@FindBy(xpath = '//UIAApplication[1]/UIAWindow[3]/UIAPicker[1]')
public WebElement pickerWheelDOB

IOSDriver driverM = (IOSDriver)this.driver

i would like a way to pass the findBy element into the driver.findelement so something like this


is this possible? i keep getting errors when i try something like this.

Why don’t u use @IOSFindBy() to locate elements.

whats the benefit of using that? but the way the platform is setup is its designed around the remote webdriver…i came in and patched in iosDriver into it, not perfect but it works… and we have a method that has the pagefactory in it and it cant have IOSElements in the FindBy’s