当我使用Selenium进行自动化测试时,我遇到了一个问题,以下是所有情况:
页面顶部有几个标签,现在我想点击这些标签并填写这些标签下的所有表单,但如果我在formA
下提交tabA
,那么我可以不自动导航到其他标签。如果我没有提交表格数据,那么问题就不会发生。这是日志:
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}}
答案 0 :(得分:3)
此错误消息......
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 / Web浏览会话时出现网络错误。
但是,对于有效和绝对 网址,这些网络错误的主要问题是 WebDriver 实例(即驱动程序)应该返回成功的值,其值为null
,具体取决于已更新Go Command Spec。 WebDriver 应返回错误,错误代码未知错误。
此问题仍在等待 Selenium团队到Issue#4475, GeckoDriver团队将通过Issue#770解决,这取决于 Mozilla问题 ID#1312679