selenium错误“[error] modifyWindow: Window was closed!” 解决
来源:互联网 发布:模型与算法 编辑:程序博客网 时间:2024/05/28 16:20
操作环境
window7 firefox45 seleniumIDE2.9.1
问题现象
- 在打开某个页面执行任何selenese命令log都提示[error] modifyWindow: Window was closed!
- log提示和正常运行无区别:
- selenium弹窗提示:
There was an unexpected error. Msg: Error: Current window or frame is closed!
Url: chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js, line: 778, column: 17
SeleniumError@chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:778:17
BrowserBot.prototype._handleClosedSubFrame@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1266:27
BrowserBot.prototype.getCurrentWindow@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1229:18
BrowserBot.createForWindow@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:178:5
Selenium.createForWindow@chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js:309:25
createSelenium@chrome://selenium-ide/content/selenium-runner.js:391:18
executeCommand@chrome://selenium-ide/content/selenium-runner.js:431:16
Debugger.prototype.executeCommand@chrome://selenium-ide/content/debugger.js:173:5
.executeCurrentCommand@chrome://selenium-ide/content/treeView.js:523:21
.initialize/controller.doCommand@chrome://selenium-ide/content/treeView.js:84:55
goDoCommand@chrome://global/content/globalOverlay.js:100:7
ondblclick@chrome://selenium-ide/content/selenium-ide.xul:1:1
问题解决
firefox中打开firebug调试工具,在控制台处将window的关闭信息打印出来查看alert(window.closed)/console.log(window.closed)
在正常状态下,应该打印出来false(or true)
在那个特定的网页中打印出来结果:
这样当然JS无法正确获取window是否关闭的正确信息。
经查找函数来自此页面的main.jsp
main.jsp函数:
function closed(){ $("#queryMemberName").val(null); }
将此函数的名称修改,更好的方式应该是将自己的代码都加入特定命名空间来解决这一问题。
参考文档:
Mozilla Developer Network
- selenium错误“[error] modifyWindow: Window was closed!” 解决
- client backup was not attempted because backup window closed 错误解决一例
- Spring+Hibernate中(the owning Session was closed错误)的详细解决过程
- The underlying connection was closed错误
- Jekyll报'Tag was never closed'错误
- The underlying connection was closed错误
- configure: error: *** libmcrypt was not found 错误解决
- 解决 OpenSSH - “ Error: Connection closed by server with exitcode 128 ” 错误(ZT)
- adb调试emulator出现error:closed错误
- 解决"The underlying connection was closed: A connection that was expected to be kept alive was closed"
- Window.closed
- struts+Spring+Hibernate中(the owning Session was closed错误)
- hibernate错误:org.hibernate.SessionException: Session was already closed
- could not initialize proxy - the owning Session was closed解决
- Hibernate no session or session was closed 解决
- 解决no session or session was closed的问题
- spring boot之解决懒加载session was closed问题
- Appium 报错:org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
- 如何成为一个linux开发人员
- 用Html+js自己写了一个小游戏
- 文章标题
- SSM框架重构达内NETCTOSS项目——(3)中文乱码
- (三)Ubuntu下常用快捷键
- selenium错误“[error] modifyWindow: Window was closed!” 解决
- Spring MVC 4.1.3 + MyBatis 零基础搭建Web开发框架(注解模式哦)
- MongoDB 3.4 高可用集群搭建(二)replica set 副本集
- PAT 甲级 1114
- ADB远程连接
- Android动态改变app在桌面上的icon
- 利用dom4j.jar自制实例化Spring容器
- 用人话解释比特币原理(转载)
- 小金学呀学不会英语