selenium - 使用 Selenium Web 驱动程序和无头 Chrome 浏览器的 UI 自动化在 Linux 服务器上花费更多时间
问题描述
我们有一个 Angular 应用程序,我们正在使用 Selenium Web Driver(version) 进行测试。我们在 2 种模式下执行了此测试,即 Selenium hub nspoke 模型,其中自动化二进制文件在 Linux 服务器上运行,应用程序投影在 Windows 机器上。其次,在 Linux 服务器本身上使用无头模式的 Chrome 进行自动化二进制运行和应用程序投影。我们观察到,在第二种方法中,它比第一种方法花费更多时间。此外,浏览器会间歇性地崩溃。
组件版本如下:-
- Chrome 版本 -> 83.0.4103.61
- 硒版本-> 3.14.0
- 角度版本-> 5.2.11
- Linux 服务器操作系统版本 -> CentOS Linux 版本 7.6.1810 (Core) 你知道 Chrome 的指定版本在无头模式下运行 Selenium 自动化时是否有任何问题吗?如果否,您能否提出解决此问题的方法?
以下是错误堆栈跟踪:-
java.lang.AssertionError: org.openqa.selenium.WebDriverException: chrome 无法访问
(会话信息:无头 chrome=83.0.4103.61)
构建信息:版本:'3.14.0',修订:'aacccce0',时间:'2018-08-02T20:19:58.91Z'
系统信息:主机:'rduqa01',ip:'192.168.160.69',os.name:'Linux',os.arch:'amd64',os.version:'3.10.0-957.el7.x86_64',java .版本:'1.8.0_181'
驱动程序信息:org.openqa.selenium.chrome.ChromeDriver
功能 {acceptInsecureCerts: false, browserName: chrome, browserVersion: 83.0.4103.61, chrome: {chromedriverVersion: 83.0.4103.39 (ccbf011cb2d2b..., userDataDir: /tmp/.com.google.Chrome.SoqORf}, goog:chromeOptions: { debuggerAddress: localhost:16303}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000,脚本:30000},unhandledPromptBehavior:关闭并通知,webauthn:virtualAuthenticators:true}
会话 ID:3a7b3dd65ea01f9eba09d6f6bc11b7b8
*** 元素信息:{Using=id, value=back-to-main-menu}
在 org.junit.Assert.fail(Assert.java:88)
在 org.junit.Assert.assertTrue(Assert.java:41)
解决方案
推荐阅读
- ios - 斯威夫特:为什么本地化有时需要添加观察者才能使其工作,但有时却不需要
- reactjs - 嵌套地图不会在本机反应中呈现 jsx
- snakemake - 通过snakemake中的规则限制工作数量
- r - ggplot2:跨多个绘图的统一色标
- powershell - 如何将图像放入从命令行生成的 Lotus Notes 电子邮件中?
- vba - VBA,在列(C)中查找最大值并返回其值和相邻单元格的值
- javascript - 如何在反应中使用gapi
- java - 如何修复 maven 依赖 it.sauronsoftware 问题?
- android - android AOSP 构建树中的供应商应用程序
- kotlin - 预期顶级声明上的顶级声明错误