1

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

  1. 硒-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)

谁能帮我们解决这个错误?

4

0 回答 0