//Parent Class
public class ParentPageObjectClass {
WebDriver driver;
WebDriverWait wait;
public PipeLinePage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
//Child Class
Public class ChildPageObjectClass extends ParentPageObjectClass {
AppiumDriver<MobileElement> driver;
public LoanPipelinePage(AppiumDriver<MobileElement> driver) {
super(driver);
this.driver = driver;
PageFactory.initElements(new AppiumFieldDecorator(driver, ofSeconds(5)), this);
}
@AndroidFindBy(accessibility = PipelineConsts.LOAN_READONLY_NO_BTN)
@iOSXCUITFindBy(accessibility = PipelineConsts.LOAN_READONLY_NO_BTN)
public MobileElement readOnlyNoBtn;
I am automating Hybrid app where i have existing webDriver page classes & want extend those within appium page object clasess so i can use the existing methods. insted of creating 2 seperate classes i want to extend the old page object class
but getting below error while creating object of Child class. Above is the code snippet
Error is in PageFactory.initElements(driver, this); of parent class
Error : java.lang.IllegalArgumentException: Can not set io.appium.java_client.MobileElement field com.elliemae.qa.encw.pipeline.LoanPipelinePage.readOnlyNoBtn to com.sun.proxy.$Proxy26
If i dont extend class it works fine
Also if i dont use @@AndroidFindBy/@iOSXCUITFindBy annotations it works fine
Can some one please help me