Appiumdriver否这样的方法错误Factory.createDefault()

时间:2019-07-03 13:44:35

标签: java selenium-webdriver appium winappdriver

我正在尝试使用AppiumDriver进行一些WinAppDriver测试。我可以通过使用RemoteWebDriver来使WinAppDriver与Appium一起使用,但是当我尝试使用AppiumDriver时,我在AppiumCommanExecutor.java第93行(其中HttpClient.Factory.createDefault()

)中出现了无方法错误。

我尝试将Appium的版本更改为6.0.0,并且还尝试将Guava的版本更改为23.0。我正在使用以下版本

  • Selenium远程Webdriver-3.141.59
  • Guava-27.1-jre(我也尝试过23.0)
  • Appium Java客户端-7.0.0(还尝试了6.0.0)
       public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
        URL addressOfRemoteServer) {
        this(additionalCommands, addressOfRemoteServer, 
        HttpClient.Factory.createDefault());}
private WebDriver driver;

driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
        sessionId = ((AppiumDriver)driver).getSessionId().toString();
        return (AppiumDriver) driver;


This is the error I'm seeing below. 


java.lang.NoSuchMethodError: org.openqa.selenium.remote.http.HttpClient$Factory.createDefault()Lorg/openqa/selenium/remote/http/HttpClient$Factory;
    at io.appium.java_client.remote.AppiumCommandExecutor.<init>(AppiumCommandExecutor.java:93)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:93)
    at ssd.managers.WebDriverManager.createAppiumDriver(WebDriverManager.java:67)
    at ssd.managers.WebDriverManager.createDriver(WebDriverManager.java:49)
    at ssd.managers.WebDriverManager.getDriver(WebDriverManager.java:43)
    at ssd.cucumber.TestContext.<init>(TestContext.java:15)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

0 个答案:

没有答案