Failed to initialize object with generic type via AppiumFieldDecorator
Hello,
when I want to use pages with generic types, I get those:
Objects:
public class TempLoginPage<T> { public List<T> items; public List<T> getItems() { return items; } } public class LoginPage extends TempLoginPage<Object> { @iOSFindBy(uiAutomator = ".buttons()['Login']") public WebElement loginButton; } // main PageFactory.initElements(new AppiumFieldDecorator(getDriver()), new LoginPage());
Crashes with:
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorateWidget(AppiumFieldDecorator.java:185) at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorate(AppiumFieldDecorator.java:160) at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:113) at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105) at ... 47 more
I'm using 3.3.0 java client