io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException

huangapple go评论82阅读模式
英文:

io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException

问题

我在通过Jenkins在远程虚拟机上启动测试时遇到以下错误,但是在我的本地机器上测试可以正常运行。

io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException: C:\Users\Administrator\.m2\repository\webdriver\geckodriver\win64\v0.26.0\geckodriver.exe

在2020年4月30日之前,测试是正常工作的。

WebDriver管理器版本 - 3.8.1,
geckodriver版本 - 0.26

英文:

I have the following error when start tests on remote VM via Jenkins, however tests work without any issues on my local machine.

io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException: C:\Users\Administrator\.m2\repository\webdriver\geckodriver\win64\v0.26.0\geckodriver.exe

The tests worked correctly before and this issue started to appear from 30/04/2020/.

WebDriver manager version - 3.8.1,
geckodriverVersion - 0.26

答案1

得分: 1

在我的情况下,forceDownload()允许测试下载并覆盖当前驱动程序版本文件夹。如果geckodriver.exe正在运行(在任务管理器中检查),那么它不能覆盖正在运行的程序。

因此,在执行测试之前,您应该检查该程序是否正在运行。如果正在运行,您必须强制关闭geckodriver.exe

另外,不要忘记,如果发生异常,您应该退出驱动程序。

if (driver) {
    driver.quit();
}
英文:

In my case, forceDownload() allows the test to download and overwrite the current driver version folder. If geckodriver.exe is running on (check on Task Manager), so it could not overwrite a running program.

So, before executing the test, you should check whether that program is running or not. If it is running, you must force close geckodriver.exe.

Otherwise, don't forget that you should quit the driver if an exception occurs.

if (driver) {
    driver.quit();
}

答案2

得分: 0

我有类似的问题。
在从 Jenkins 运行时,会显示以下问题。但如果我从 Windows 的 cmd.exe 中运行,则会通过。

> io.github.bonigarcia.wdm.WebDriverManagerException: org.apache.http.conn.ConnectTimeoutException: 连接到 chromedriver.storage.googleapis.com:443 [chromedriver.storage.googleapis.com/34.64.4.112] 失败:读取超时
	at CsdAutomationE2E.testflows.script.JDCLOUD200618.TestStep1.beforeTest(TestStep1.java:56)
英文:

I have similar issue.
While running from Jenkins, it shows the following issue. But it would pass if I run it from windows cmd.exe.

> io.github.bonigarcia.wdm.WebDriverManagerException: org.apache.http.conn.ConnectTimeoutException: Connect to chromedriver.storage.googleapis.com:443 [chromedriver.storage.googleapis.com/34.64.4.112] failed: Read timed out
at CsdAutomationE2E.testflows.script.JDCLOUD200618.TestStep1.beforeTest(TestStep1.java:56)

huangapple
  • 本文由 发表于 2020年5月4日 21:29:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/61593395.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定