【发布时间】:2016-05-19 04:20:39
【问题描述】:
切换到新窗口后,只有 'urlContains' 有效。
没有其他事情发生(点击也没有 elementVisible 或任何事情)
守夜人部分代码:
'Order Module' : function(browser) {
browser
.useXpath()
.waitForElementVisible("@OrderTab", 20000)
.pause(5000)
.click("@OrderTab")
.pause(5000)
.useCss()
.waitForElementVisible("input[title = 'New']", 20000)
.click("input[title = 'New']")
.useXpath()
.waitForElementVisible("@OrderTextBox']", 20000)
.verify.urlContains('https://invoiceit-s.na30.visual.force.com/apex/createJobStep1?retURL=%2Fa0K%2Fo&save_new=1&sfdc.override=1')
.setValue("@OrderTextBox", "Order Name")
.pause(10000)
.click("@LinkIconForNewWindow")
.pause(10000)
.window_handles(function(result) {
this.verify.equal(result.value.length, 2, '2 windows should be open')
var handle = result.value[1]
this.switchWindow(handle)
this.verify.urlContains('https://invoiceit-s.na30.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3AjobForm&lknm=j_id0%3AjobForm%3Apb%3Arender%3Aj_id38%3A0%3Aj_id39&lktp=001&lksrch=')
this.useXpath()
this.waitForElementVisible("@searchBox", 20000)
})
.pause(20000)
.end() }
【问题讨论】:
标签: node.js selenium-webdriver functional-testing nightwatch.js