相关文章推荐
大力的长颈鹿  ·  Use Application ...·  1 年前    · 
急躁的毛巾  ·  TADOQuery和TADOConnecti ...·  1 年前    · 
忐忑的登山鞋  ·  问题排查之RocketMQAutoConfi ...·  1 年前    · 
强健的硬币  ·  如何在nginx上设置html不缓存 - 掘金·  1 年前    · 
道上混的沙发  ·  私活之Python数据挖掘建模平台_大数据指 ...·  2 年前    · 
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());
 
推荐文章
大力的长颈鹿  ·  Use Application Health extension with Azure Virtual Machine Scale Sets - Azure Virtual Machine Scale
1 年前
急躁的毛巾  ·  TADOQuery和TADOConnection内存泄漏 - 问答 - 腾讯云开发者社区-腾讯云
1 年前
忐忑的登山鞋  ·  问题排查之RocketMQAutoConfiguration not loaded. - 掘金
1 年前
强健的硬币  ·  如何在nginx上设置html不缓存 - 掘金
1 年前
道上混的沙发  ·  私活之Python数据挖掘建模平台_大数据指北的博客-CSDN博客
2 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号