Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java.lang.IllegalAccessError from PageFactory when I switch to java-client 3.2.0 #5683

Closed
mkataokaelementum opened this issue Oct 3, 2015 · 5 comments

Comments

@mkataokaelementum
Copy link

If I do "PageFactory.initElements(new AppiumFieldDecorator(driver), this);" with java-client 2.2.0 it works. If I switch to java-client 3.2.0, java.lang.IllegalAccessError occurs.

Does anyone know what is going on?

Here are the logs.

java.lang.IllegalAccessError: tried to access method org.openqa.selenium.support.pagefactory.Annotations.assertValidAnnotations()V from class io.appium.java_client.pagefactory.AppiumAnnotations
at io.appium.java_client.pagefactory.AppiumAnnotations.assertValidAnnotations(AppiumAnnotations.java:222)
at io.appium.java_client.pagefactory.AppiumAnnotations.buildBy(AppiumAnnotations.java:315)
at io.appium.java_client.pagefactory.AppiumElementLocator.(AppiumElementLocator.java:109)
at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:41)
at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorate(AppiumFieldDecorator.java:102)
at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:112)
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:104)
at com.elementum.qe.clients.android.exposure.pages.LoginPage.(LoginPage.java:29)
at com.elementum.qe.clients.android.exposure.testng.NewCreateIssueTest.beforeTest(NewCreateIssueTest.java:42)

@triager triager added the Needs Triage bugs which are not yet confirmed label Oct 3, 2015
@s2005lg
Copy link

s2005lg commented Oct 5, 2015

Maybe you need to change as below:

PageFactory.initElements(new AppiumFieldDecorator(driver, 5,TimeUnit.SECONDS), this);

It works on my laptop

@mkataokaelementum
Copy link
Author

Tested with java-client 3.2.0. It did not work.... Below is my partial code. Any idea?

public class CommonMobileLoginPage extends PageObjectBase implements ILoginPage {

public AppiumDriver driver;

public CommonMobileLoginPage(AppiumDriver driver) {
    super();
    this.driver = driver;
    PageFactory.initElements(new AppiumFieldDecorator(driver,5, TimeUnit.SECONDS), this);
}

@SrinivasanTarget
Copy link
Member

@mkataokaelementum please give a try in appium 1.5.1 and java-client 3.4.1.Incase of issues, please report here,https://github.com/appium/java-client/issues

FYI https://github.com/appium/java-client/blob/master/docs/Page-objects.md

@SrinivasanTarget
Copy link
Member

@triager please close

@triager triager closed this as completed Apr 8, 2016
@imurchie imurchie removed the Needs Triage bugs which are not yet confirmed label Jul 13, 2017
@lock
Copy link

lock bot commented Apr 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants