切換幀誰能告訴我如何與iframe中引用的元素進行幀的切換完成後?我已經看了看How to switch iframes InternJS呈現無濟於事的解決方案,並在intern Functional Testing with Frames的信息是不適用下面的腳本返回Cannot read property 'apply' of undefined type: TypeError
錯誤(但):如何進行後InternJS
return Remote
.findAllByTagName('iframe')
.then(function (frames) {
return new Remote.constructor(Remote.session)
.switchToFrame(frames[0])
.getProperty('title')
.then(function (result) {
expect(result).to.equal('Rich text editor, rtDescAttach');
});
});
唯一的原因,我可以看到腳本失敗的原因是框架位置不正確。網頁上有兩個,我需要第一個。一旦完成,我真的很想把這個框架的引用放在一個頁面對象中(這是我感覺它屬於的地方),但我必須能夠成功找到它,所以不要把它放在馬前。建議和幫助非常感謝。
OMG,你只是完全讓我很快樂!明天早上我會給你賞金的第一件事。你有我不朽的感謝! – MBielski