小编tes*_*986的帖子

使用 Selenium 和 Java 9 执行自动化测试时发生非法反射访问操作

我的硒测试有一个奇怪的问题

当我打开我的 chrome 浏览器时,我收到 2 个错误:

[1569419754.430][WARNING]: Timed out connecting to Chrome, retrying...
[1569419759.899][WARNING]: Timed out connecting to Chrome, retrying...
Run Code Online (Sandbox Code Playgroud)

在浏览器实际打开之前。我还注意到在测试结束时有很多警告:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openqa.selenium.os.ProcessUtils 
WARNING: Please consider reporting this to the maintainers of org.openqa.selenium.os.ProcessUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Run Code Online (Sandbox Code Playgroud)

我尝试更新 maven 依赖项:

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.0.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

但是它破坏了我所有的测试,我无法初始化浏览器,还有其他人有这个问题吗?

java selenium selenium-webdriver java-9 java-module

3
推荐指数
1
解决办法
9676
查看次数

标签 统计

java ×1

java-9 ×1

java-module ×1

selenium ×1

selenium-webdriver ×1