java-client
java-client copied to clipboard
Pagefactory not initialise the @AndroidFindby and iOSFindBy but @Findby is work fine.
Description
while initialise the AppiumDriver<MobileElement> through pagefactory its not able to initialise the @AndroidFindby and iOSFindBy but @Findby is work fine.
Environment
- Java client build version or git revision if you use some snapshot: java client 7.3
- Appium server version or git revision if you use some snapshot: 1.22.3
- Desktop OS/version used to run Appium if necessary: Mac 13.4.1 (22F82)
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: node V18.16.0
- Mobile platform/version under test: Android/12 and 13, Ios/16.4
- Real device or emulator/simulator: Real devices and emulator/simulator
Details
Please provide more details, if necessary.
Code To Reproduce Issue
LoginPageElements_Mobile_DTT LoginPageElements_Mobile = new LoginPageElements_Mobile_DTT();
public LoginPageMethods_Mobile_DTT(RemoteWebDriver driver) {
super((AppiumDriver<MobileElement>) driver);
PageFactory.initElements(new AppiumFieldDecorator(driver, Duration.ofSeconds(1)), LoginPageElements_Mobile);
}
//on the page class
@AndroidFindBy(xpath = "//*[contains(@text,'Already have an account? Login')]")
public MobileElement mrp_lbl;
Error:
java.lang.RuntimeException: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy15.proxyClassLookup()
java.lang.RuntimeException: java.lang.NoSuchMethodException:
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105)
at android.appium.DTT.login.LoginPageMethods_Mobile_DTT.
Exception Stacktraces
Please create a gist with the pasted stacktrace of the exception thrown by java.
Link To Appium Logs
Please try to use the latest version of the client