微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

尝试在本地触发弹出窗口但不在 GitLab 中,给出 org.openqa.selenium.NoSuchWindowException:浏览上下文已被丢弃

如何解决尝试在本地触发弹出窗口但不在 GitLab 中,给出 org.openqa.selenium.NoSuchWindowException:浏览上下文已被丢弃

我正在测试通过以任何方式(包括切换标签等)将光标移出页面内容而触发的弹出窗口。

在本地,我尝试过切换选项卡、按偏移量移动光标、单击 URL,它们都在本地工作,但我的测试在 GitLab 中失败。

我在尝试按偏移量点击时遇到的错误之一是:

org.openqa.selenium.NoSuchWindowException: browsing context has been discarded
Build info: version: '3.141.59'
java.version: '1.8.0_282'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: true,browserName: firefox,browserVersion: 85.0,javascriptEnabled: true,moz:accessibilityChecks: false,moz:buildID: 20210118153634,moz:geckodriverVersion: 0.29.0,moz:headless: false,moz:processID: 75,moz:profile: /tmp/rust_mozprofileTi9Klr,moz:shutdownTimeout: 60000,moz:useNonSpecCompliantPointerOrigin: false,moz:webdriverClick: true,pageLoadStrategy: normal,platform: LINUX,platformName: LINUX,platformVersion: 4.19.0-13-amd64,rotatable: false,setwindowRect: true,strictFileInteractability: false,timeouts: {implicit: 0,pageLoad: 300000,script: 30000},unhandledPromptBehavior: dismiss and notify,webdriver.remote.sessionid: a30a1170-c58e-4aa5-8e2d-5dd...}
Session ID: a30a1170-c58e-4aa5-8e2d-5dd1e56d192e
*** Element info: {Using=id,value=header}

我无法弄清楚如何在不破坏浏览器的情况下触发 gitlab 中的弹出窗口。它也不适用于 Chrome。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。