我正在使用Selenium.Winium工具进行自动化。我已包含以下用于导入selenium.winium软件包的jar文件
下面是我的Java代码:
import org.openqa.selenium.By;
import org.openqa.selenium.winium.DesktopOptions;
import org.openqa.selenium.winium.WiniumDriver;
import org.openqa.selenium.WebElement;
import java.net.MalformedURLException;
import java.net.URL;
public class WiniumTestProject
{
public static void main(String[] args) throws MalformedURLException, InterruptedException
{
DesktopOptions options= new DesktopOptions();
options.setApplicationPath("C:\\Windows\\System32\\calc.exe");
try
{
WiniumDriver driver=new WiniumDriver(new URL("http://localhost:9999"),options);
driver.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
错误详细信息:
在“命令”窗口中通过命令“ java ProjectName”运行项目时,将引发以下错误。
Exception in thread "main" java.lang.NoSuchMethodError:
org.openqa.selenium.remote.HttpCommandExecutor.<init>(Ljava/util/Map;Ljava/net/URL;)V
at org.openqa.selenium.winium.WiniumDriverCommandExecutor.<init>(WiniumDriverCommandExecutor.java:64)
at org.openqa.selenium.winium.WiniumDriver.<init>(WiniumDriver.java:84)
at WiniumTestProject.main(WiniumTestProject.java:18)
任何人都可以帮助我们解决此错误吗?