appium / appium/java-client

Pagefactory not initialise the @AndroidFindby and iOSFindBy but @Findby is work fine.

Open
#1,956 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

while initialise the AppiumDriver 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.(LoginPageMethods_Mobile_DTT.java:119)

Exception Stacktraces

Please create a gist with the pasted stacktrace of the exception thrown by java.

Link To Appium Logs

<script src="https://gist.github.com/saravanan060694/5233ce62b82dea619b3aa2bd39a84398.js"></script>


gist:5233ce62b82dea619b3aa2bd39a84398

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PageFactory.initElements call and AppiumFieldDecorator setup shown in the reproducer, then inspect how @AndroidFindBy and iOSFindBy are handled compared with @FindBy. Use the reported jdk.proxy2.$Proxy15.proxyClassLookup() stack trace and the linked Appium log as the first diagnostic evidence. Done means the reproducer initializes Android and iOS annotated fields without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.