【发布时间】:2015-06-16 14:49:43
【问题描述】:
我将量角器与黄瓜一起使用,每当需要在带有 phantomjs 的浏览器选项卡之间切换时,它就会挂起而没有任何错误消息。然而,同样的步骤适用于 Chrome 浏览器。这是为什么?我的步骤如下
this.Then(/^the page url hash should be "([^"]*)"$/, function (arg1, callback) {
browser.getAllWindowHandles().then(function (handles) {
newWindowHandle = handles[2];
browser.switchTo().window(newWindowHandle).then(function () {
expect(browser.driver.getCurrentUrl()).to.eventually.contain(arg1).and.notify(callback);
});
});
【问题讨论】:
-
“我们建议不要使用 PhantomJS 进行 Protractor 测试。据报道,PhantomJS 崩溃和行为与真实浏览器不同的问题很多。” angular.github.io/protractor/#/browser-support
标签: selenium testing phantomjs protractor cucumberjs