maven - 在 Maven 项目中使用 Selenium
问题描述
我在 Eclipse 中使用以下依赖项创建了一个 MavenTestProject:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
现在我的 Maven 依赖项文件夹包含这些浏览器的驱动程序:
这些库是干什么用的?我可以只使用它们吗?还是我还需要下载其他 .exe 文件才能使用其他帖子中提到的驱动程序?
解决方案
在 Chrome 上执行测试用例时需要下载 ChromeDriver.exe,ChromeDriver.exe 接受来自 Selenium 的命令,然后与 Chrome 浏览器通信。所以你需要下载exe文件。
推荐阅读
- java - 由于 intellij 中的 'io/soabase/recordbuilder/processor/RecordBuilderProcessord,无法加载处理器类文件
- php - 无法从 Walmart API 获取商品
- html - For 属性可以与 HTML 表单中的 name 属性连接吗?
- javascript - 找出哪个正则表达式与 JavaScript 中的给定字符串匹配
- python - 在kivy应用程序中禁用最小化和最大化按钮
- c# - 忽略 Stryker 突变测试中的日志条目
- mysql - 从 MySQL 5 表,增量计数器和限制相同的出现
- python - 我想知道如何将带有值列表的字典映射到数据框
- spring-boot - 尝试使用 Tomcat 在 Docker 中将 Springboot 应用程序作为 war 文件运行时出现问题
- sbt - SBT 1.5.5 在使用 -mem 选项运行测试时出错