为了账号安全,请及时绑定邮箱和手机立即绑定

如何解决“包 org.openqa.selenium.winium 不存在”的错误?

如何解决“包 org.openqa.selenium.winium 不存在”的错误?

一只名叫tom的猫 2021-09-12 20:04:56
我正在使用Winium 工具进行自动化。我已将以下 jar 文件包含到我的项目的类路径中,selenium-server-standalone-3.14.0.jartestng-7.0.0-beta1.jarwinium-elements-desktop-0.1.0-1.jarwinium-elements-desktop-0.2.0-1.jarJava 安装版本:1.8当我尝试编译程序时,出现以下错误。D:\Incidents\Winium_213716\TestProjects\winium-desktop-sample-project-master\winium-desktop-sample-project-master\src\main\java>javac sampleTest.javasampleTest.java:44: error: package org.openqa.selenium.winium does not existimport org.openqa.selenium.winium.DesktopOptions;                             ^sampleTest.java:45: error: package org.openqa.selenium.winium does not existimport org.openqa.selenium.winium.WiniumDriver;                             ^sampleTest.java:52: error: cannot find symbolDesktopOptions options= new DesktopOptions();^symbol:   class DesktopOptionslocation: class sampleTestsampleTest.java:52: error: cannot find symbolDesktopOptions options= new DesktopOptions();                          ^symbol:   class DesktopOptionslocation: class sampleTestsampleTest.java:55: error: cannot find symbolWiniumDriver driver=new WiniumDriver(new URL("http://localhost:9999"),options);  ^symbol:   class WiniumDriverlocation: class sampleTestsampleTest.java:55: error: cannot find symbolWiniumDriver driver=new WiniumDriver(new URL("http://localhost:9999"),options);                       ^symbol:   class WiniumDriverlocation: class sampleTest6 errors下面是我的java代码import java.io.IOException;import java.net.URL;import org.openqa.selenium.winium.DesktopOptions;import org.openqa.selenium.winium.WiniumDriver;import org.testng.annotations.Test;public class sampleTest { @Test public void test() throws IOException{ DesktopOptions options= new DesktopOptions(); options.setApplicationPath("C:\\WINDOWS\\system32\\notepad.exe");  try{  WiniumDriver driver=new WiniumDriver(new   URL("http://localhost:9999"),options);  driver.findElementByClassName("Edit").sendKeys("This is  sample test");  driver.close(); } catch(Exception e){ System.out.println(e.getMessage());}}
查看完整描述

2 回答

?
HUX布斯

TA贡献1876条经验 获得超6个赞

您需要Winium Web 驱动程序jar 来进行上述导入


查看完整回答
反对 回复 2021-09-12
  • 2 回答
  • 0 关注
  • 769 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信