相关文章推荐
伤情的核桃  ·  有没有什么工具可以把c语言翻译成java语言 ...·  7 月前    · 
豪爽的香槟  ·  双引号如何替换成单引号 - OSCHINA ...·  1 年前    · 
小眼睛的毛豆  ·  将QPixmap保存为竖线中的JPEG结果- ...·  1 年前    · 
好帅的领带  ·  C# ...·  1 年前    · 
痴情的雪糕  ·  Flink 使用之 CEP - 简书·  1 年前    · 
Code  ›  如何解决“包org.openqa.selenium.winium不存在”错误?开发者社区
https://cloud.tencent.com/developer/ask/sof/115365533
没人理的仙人球
1 年前
首页
学习
活动
专区
工具
TVP 最新优惠活动
返回腾讯云官网
提问

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

Stack Overflow用户
提问于 2018-09-11 07:34:33
EN

我使用的是自动控制工具。我已经将下面的jar文件包含在我的项目的类路径中,

  1. selenium-server-standalone-3.14.0.jar
  2. testng-7.0.0-beta1.jar
  3. winium-elements-desktop-0.1.0-1.jar
  4. winium-elements-desktop-0.2.0-1.jar

Java安装版本 :1.8

当我试图编译程序时,我会遇到以下错误。

D:\Incidents\Winium_213716\TestProjects\winium-desktop-sample-project-master\winium-desktop-sample-project-master\src\main\java>javac sampleTest.java
sampleTest.java:44: error: package org.openqa.selenium.winium does not exist
import org.openqa.selenium.winium.DesktopOptions;
sampleTest.java:45: error: package org.openqa.selenium.winium does not exist
import org.openqa.selenium.winium.WiniumDriver;
sampleTest.java:52: error: cannot find symbol
DesktopOptions options= new DesktopOptions();
symbol:   class DesktopOptions
location: class sampleTest
sampleTest.java:52: error: cannot find symbol
DesktopOptions options= new DesktopOptions();
symbol:   class DesktopOptions
location: class sampleTest
sampleTest.java:55: error: cannot find symbol
WiniumDriver driver=new WiniumDriver(new 
URL("http://localhost:9999"),options);
symbol:   class WiniumDriver
location: class sampleTest
sampleTest.java:55: error: cannot find symbol
WiniumDriver driver=new WiniumDriver(new 
URL("http://localhost:9999"),options);
symbol:   class WiniumDriver
location: class sampleTest
6 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");
  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());
 
推荐文章
伤情的核桃  ·  有没有什么工具可以把c语言翻译成java语言? - CSDN文库
7 月前
豪爽的香槟  ·  双引号如何替换成单引号 - OSCHINA - 中文开源技术交流社区
1 年前
小眼睛的毛豆  ·  将QPixmap保存为竖线中的JPEG结果-腾讯云开发者社区-腾讯云
1 年前
好帅的领带  ·  C# 给PDF签名时添加时间戳的2种方法(附VB.NET代码) - 知乎
1 年前
痴情的雪糕  ·  Flink 使用之 CEP - 简书
1 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号