“线程“主”中的异常java.lang.NoSuchMethodError:org.openqa.selenium.remote.HttpCommandExecutor。<init>(Ljava / util / Map; Ljava / net / URL;)V”?

时间:2018-09-14 03:53:37

标签: java selenium automation winium

我正在使用Selenium.Winium工具进行自动化。我已包含以下用于导入selenium.winium软件包的jar文件

  1. selenium-java.jar
  2. winium-webdriver-0.1.0-1.jar
  3. webdriver-selenium-0.9.7376.jar
  4. selenium-server-standalone-3.14.0.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)

任何人都可以帮助我们解决此错误吗?

0 个答案:

没有答案