Hey there,
were you able to successfully extend MobileElements?
Could you maybe give me some examples?
i am getting the following error when i make an instance of my page objects:
`java.lang.IllegalArgumentException: Can not set com.automation.appium.Helpers.MyElement field com.automation.appium.Pages.RegistrationPage.StagingSelector to io.appium.java_client.ios.IOSElement$$EnhancerByCGLIB$$d311658`
this is MyElement:
public class MyElement extends MobileElement{
public MyElement() {}
public void assertIsDisplayed() {
Assert.isTrue(this.isDisplayed(), "not displayed");
}
}
then i have this in my AbstractPage class:
public abstract class AbstractPage{
public AbstractPage(AppiumDriver<MyElement> driver) {
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
}
}
and this is how i start my driver:
public AppiumDriver<GinloMobileElement> driver;
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), GetAndroidCapabilities());
it would be really great if someone would point out what i could do to make this work.
the general idea is to be able to add custom generic methods, which can be used on the elements, described in the pageobject structure. Any other suggestions how i can add methods, which i can use like:
Page.Element.myCustomMethod();
in my tests are very very welcome.