0
使用Selenium IDE記錄Web操作時,但IDE正在停止JavaScript,並出現錯誤消息「太多遞歸」。Selenium IDE正在停止javascript
硒IDE 2.9.1.1
瀏覽器:Firefox 54.0.1
我寫了一個簡單的JavaScript警報進行測試,它也停止硒。
<html>
<head>
<script>
function hello(){
alert("Hello\nHow are you?");
}
</script>
</head>
<body>
<input type="button" onclick="hello();" value="Say Hi" />
</body>
</html>
硒-IDE /內容/ recorder.js
Recorder.prototype.reattachWindowMethods = function() {
var window = this.getWrappedWindow();
//this.log.debug("reattach");
if (!this.windowMethods) {
this.originalOpen = window.open;
}
this.windowMethods = {};
['alert', 'confirm', 'prompt', 'open'].forEach(function(method) {
this.windowMethods[method] = window[method];
}, this);
var self = this;
window.alert = function(alert) {
self.windowMethods['alert'].call(self.window, alert);
self.record('assertAlert', alert);
}
}
顯示您的硒腳本 – Liam
剛剛更新,該例外是來這裏'self.windowMethods [ '警報']調用(self.window,警告);' – Jotzuc