【发布时间】:2023-03-26 05:58:01
【问题描述】:
我使用 Jenkins 使用 chrome 驱动程序启动 selenium 独立服务。它开始正常。但是当我将它与实习生测试一起使用时,chrome 测试不会启动。我在日志中得到了这个:
org.openqa.selenium.WebDriverException:
unknown error: Runtime.evaluate threw exception:
DOMException: Failed to read the 'localStorage' property from 'Window':
Access is denied for this document.
如果我在本地启动 selenium,一切正常。注意 Jenkins 从服务使用与本地登录相同的用户。
我用来启动 Jenkins 的批处理脚本是这样的:
start cmd /c java -jar C:\Jenkins\workspace\app\util\selenium-server-standalone-2.44.0.jar -Dwebdriver.chrome.driver=C:\Jenkins\workspace\app\util\chromedriver.exe 2^> seleniumLog.txt
为什么当我从 Jenkins 启动 selenium 时它不起作用?
【问题讨论】:
-
有哪些环境差异?同一台机器(Windows 奴隶?)...Chrome 版本? ChromeDriver 版本? Windows 版本?
-
@Arran,都一样。相同的批处理文件在同一台机器上运行。唯一的区别是从 Jenkins 运行和手动运行。
标签: google-chrome selenium jenkins intern