selenium - 到达错误页面 : about:neterror when trying to navigate to other tabs if there is a form submit under that tab

标签 selenium firefox selenium-webdriver webdriver geckodriver

当我使用 Selenium 进行自动化测试时,遇到了一个问题,以下是所有场景:

页面顶部有几个选项卡,现在我想单击这些选项卡并填写这些选项卡下的所有表单,但是如果我提交 tabA 下的 formA code>,那么我无法自动导航到其他选项卡。如果我没有提交表单数据,就不会出现这个问题。这是日志:

1513753361368 Marionette DEBUG Received DOM event "beforeunload" for "https://192.168.1.20/link.cgi?1513753343333"
1513753361388 Marionette DEBUG Received DOM event "beforeunload" for "https://192.168.1.20/link.cgi?1513753343333"
1513753361391 Marionette DEBUG Received DOM event "pagehide" for "https://192.168.1.20/link.cgi?1513753343333"
1513753361391 Marionette DEBUG Received DOM event "unload" for "https://192.168.1.20/link.cgi?1513753343333"
1513753361427 Marionette DEBUG Received DOM event "DOMContentLoaded" for "about:neterror?e=connectionFailure&u=https%3A//192.168.1.20/network.cgi&c=UTF-8&f=regular&d=Firefox%20%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%E5%88%B0%20192.168.1.20%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E8%BF%9E%E6%8E%A5%E3%80%82"
org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=https%3A//192.168.1.20/network.cgi&c=UTF-8&f=regular&d=Firefox%20%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%E5%88%B0%20192.168.1.20%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E8%BF%9E%E6%8E%A5%E3%80%82
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'PC-20161127KZEG', ip: '192.168.131.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 57.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 42248, moz:profile: C:\Users\Administrator\AppD..., moz:webdriverClick: false, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.1, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}

最佳答案

此错误消息...

org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=https%3A//192.168.1.20/network.cgi&c=UTF-8&f=regular&d=Firefox%20%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%E5%88%B0%20192.168.1.20%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E8%BF%9E%E6%8E%A5%E3%80%82

...暗示初始化 WebDriver/网络浏览 session 时出现网络错误

但是,主要问题是,如果有效绝对URL出现这些网络错误 WebDriver 实例(即驱动程序)预计会返回 Success 值以及 null 值,根据更新的Go Command SpecWebDriver 应返回错误,错误代码未知错误

此问题仍由 Selenium 团队 通过 Issue#4475 悬而未决GeckoDriver 团队将通过 Issue#770 解决这个问题这取决于 Mozilla 问题 ID#1312679

关于selenium - 到达错误页面 : about:neterror when trying to navigate to other tabs if there is a form submit under that tab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47900844/

相关文章:

javascript - Firefox 插件从网站内联安装

java - 作为 Maven 测试运行时,TestNG 测试会失败,但作为 TestNG 套件运行时会通过

java - 使用 JMeter 运行 Selenium 脚本

javascript - 无法在 Firefox 中使用内联 JavaScript 更改输入类型

javascript - Firefox 动态生成链接点击

java - 无法创建新的 Chrome 远程 session

r - 无法通过 RStudio 的任务调度程序启动浏览器

java - 如何创建 isSecure 标志为 false 的 org.openqa.selenium.Cookie

Python django : How to call selenium. set_speed() 与 django LiveServerTestCase

python - 将 selenium 与 python beautifulsoup 库一起使用时出现回溯错误