私はソーダ(https://github.com/LearnBoost/soda)を使用して、いくつかのセレンテストを作成しています。ただし、getEvalで問題が発生しています。
私はこれらのヘルパーを定義しています:
soda.prototype.two = function() {
return this.getEval('this.browserbot.getCurrentWindow().document.getElementsByTagName("body").length == 1;');
}
soda.prototype.one = function() {
var x = this.two();
return this.assertValue(x, true);
}
テストでは、私は持っています:
browser
.chain
.session()
.open('/g/48hLQZPRj')
.one()
...
ただし、これはテスト結果ログです。
open: /g/48hLQZPRj
getEval: this.browserbot.getCurrentWindow().document.getElementsByTagName("body").length == 1;
assertValue: [object Object], S
testComplete:
[Error: assertValue([object Object], S): Element not found]
getEvalがオブジェクトを返すのはなぜですか?期待どおりにブール値が返されないのはなぜですか?私は何が欠けていますか?ありがとう!