Hi,
We don't need to worry about this. All this is done automatically in the background. When you run your scripts for Android, the driver is instantiated as AndroidDriver -
WebDriver driver = new AndroidDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
After this, when it looks for the elements - it will automatically search for @AndroidFindBy(...)
. Similar is the case with iOS, where since the driver would be of type IOSDriver, the driver will always look for @IOSFindBy(...)
In short, just run your scripts for Android or iOS. The driver would automatically pick up from @AndroidFindby()
or @IOSFindBy
on its own.