【发布时间】:2014-04-19 00:51:07
【问题描述】:
使用 .frame JSON Wire Protocol 调用可以更深入地移动到 DOM 树中,但我无法找到向上移动通过 DOM 树的方法。
module.exports = {
"Enter and exit iframes in tree" : function(browser){
browser
//Currently focus is at top level.
.frame('iframeOne')
//Focus is now enters inner frame iframeTwo
.frame('iframeTwo')
//Attempt to move to frame directly
.frame('iframeOne')
//Selenium Error 'no such frame'
//Attempt to move focus up to iframeOne by searching from root.
.element('id', 'iframeOne', function(e){
browser.frame(e.value);
}
//Selenium Error 'no such element'
}
有一个 JSON Wire Protocol 调用 frame/parent 能够向上移动到父元素,但 NightWatchJS 目前不支持它。任何建议将不胜感激。
【问题讨论】:
标签: javascript node.js selenium selenium-webdriver automated-tests