我正在尝试使用AppiumDriver进行一些WinAppDriver测试。我可以通过使用RemoteWebDriver来使WinAppDriver与Appium一起使用,但是当我尝试使用AppiumDriver时,我在AppiumCommanExecutor.java第93行(其中HttpClient.Factory.createDefault()
)中出现了无方法错误。我尝试将Appium的版本更改为6.0.0,并且还尝试将Guava的版本更改为23.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)