android java.lang.IllegalAccessError:尝试访问方法org. openqa. selenium. remote. http. ClientConfig

oxcyiej7  于 2022-12-31  发布在  Android
关注(0)|答案(1)|浏览(318)

当我尝试从eclipse运行一个测试用例时,我得到了这个错误:我使用的是Eclipse,Appium服务器图形用户界面Windows-1.22.3 - 4,Android 4:java-client-8.2.1.jar
我需要你的帮助代码:

@Test
    public void test() throws  MalformedURLException{
        //fail("Not yet implemented");
        URL link = new URL("http://127.0.0.1:4723/wd/hub");
        //AndroidDriver driver;
        DesiredCapabilities capacidades = new DesiredCapabilities(); 
        capacidades.setCapability("platformName", "Android");
        capacidades.setCapability("appium:platformVersion", "13");
        capacidades.setCapability("appium:appActivity", "com.BancaxcxcxActivity");
        capacidades.setCapability("appium:appPackage", "com.banxxxv40");
        capacidades.setCapability("appium:deviceName", "sdk_gphone64_x86_64");
        
        // Inicio driver
        AndroidDriver driver = new AndroidDriver(link ,capacidades);

    }

错误:

java.lang.IllegalAccessError: tried to access method org.openqa.selenium.remote.http.ClientConfig.<init>
(Ljava/net/URI;
Ljava/time/Duration;
Ljava/time/Duration;
Lorg/openqa/selenium/remote/http/Filter;
Ljava/net/Proxy;Lorg/openqa/selenium/Credentials;)
V from class io.appium.java_client.AppiumClientConfig

    at io.appium.java_client.AppiumClientConfig.<init>(AppiumClientConfig.java:62)
    at io.appium.java_client.AppiumClientConfig.defaultConfig(AppiumClientConfig.java:79)
    at io.appium.java_client.remote.AppiumCommandExecutor.<init>(AppiumCommandExecutor.java:109)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:92)
    at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:117)
    at consolePruebasTest.TestMovil.test(TestMovil.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

我正在尝试与模拟设备进行初始连接。

hm2xizp9

hm2xizp91#

java-client 8.2.1在解析依赖关系时存在问题:https://github.com/appium/java-client/issues/1812
升级到8.3.0并检查。

相关问题