selenium-webdriver - git上的硒中的NoSuchSessionException
问题描述
我在 Firefox 浏览器上运行 selenium 脚本。该脚本在本地系统上执行良好,但是当我们将代码推送到 GIT 并执行管道时,它会在执行一些步骤后通过抛出以下异常而中断:
org.openqa.selenium.NoSuchSessionException: Tried to run command without establishing a connection
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'XXXXXXXXXXXXX', ip: '1XXXXXX', os.name: 'Linux', os.arch: 'amd64', os.version: 'XXXXX-aws', java.version: '1.8.0_242'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 75.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20200403170909, moz:geckodriverVersion: 0.26.0, moz:headless: false, moz:processID: 64, moz:profile: /tmp/rust_mozprofilerzeT93, moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 00000aws, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: 7061f603-50d8-48c7-bfc0-e75...}
Session ID: 7061f603-50d8-48c7-bfc0-e7540fd5c115
YML 文件有这个代码来获取 Firefox 驱动程序:
services:
- selenium/standalone-Firefox
铬也会发生同样的事情。当系统没有找到该元素并去截屏脚本时我观察到的会引发此错误。这是间歇性的,有些时候效果很好。
如果遇到此类问题,请提供帮助。
解决方案
推荐阅读
- omnet++ - 在 ubuntu 上修改 Castlia 3.3 + omnetpp 5.3 - 权限被拒绝
- d3.js - 减少词云 zingcharts 中的空白?
- bash - 如果在 heredoc (ssh ... <
如果命令在
EOF
. 但我无法使用变量来存储命令或将输出存储在文件中。例如:
#!/bin/bash a='Some other commands in local machine' ssh ubuntu@xx.xx.xx.xx << EOF echo $a; ldt=$(date +'%Y%m%d') aw
- apache-storm - 向 Storm 拓扑添加交互式元素
- json - 理解这个无对象的 JSON
- database - db2 import export 到相同的 ixf 但不同的进程
- javascript - 将数据传递给 ngAfterViewInit() 中的函数 - Angular 6
- mysql - MySQL Pass max() 列作为间隔天数
- android - 翻译成阿拉伯语时,浮动按钮向右移动
- ios - 通过 kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly 没有 FaceID 的 SecItemCopyMatching