Hi,
I am using PageObjectModel/PageFactory for my tests on an android native app.
Everything is working fine except the tap() method. Java throws "com.sun.proxy.$Proxy22 cannot be cast to org.openqa.selenium.remote.RemoteWebElement" exception when trying to execute this method.
Below is some part of the code:
AndroidDriver driver = new AndroidDriver(new URL("..."), capabilities);
@FindBy(xpath = "//android.widget.TextView[@text='Message']")
public WebElement messageAppOnTile;
PageFactory.initElements(driver, pageObject);
driver.tap(1, pageObject.messageAppOnTile, 500);
Java throws this exception when trying to execute the above line - "com.sun.proxy.$Proxy22 cannot be cast to org.openqa.selenium.remote.RemoteWebElement"
And tap() worked fine when I tried driver.tap(1, driver.findElement(By.xpath("//android.widget.TextView[@text='Message']")), 500);
Selenium - 2.53.0
Appium Java Client - 3.4.1
Appium Server - 1.4.16.1
Why tap is not working when WebElements are initialised using PageFactory.initElements()?
Has anyone seen this issue before?
Thanks.