我在桌面上运行了一个量角器脚本(chrome,firefox,safari)和iPhone(safari)。它的工作正常,除了iPhone Safari之外。如果我们运行该脚本,它将单击一个链接,该链接将在新选项卡上打开一个页面。但看起来似乎没有发生click()事件。我可以通过在脚本运行时查看iPhone浏览器来判断。脚本如下。
it('click on about room5',function () {
browser.driver.findElement(By.css("a[href='/about']")).click();
browser.driver.sleep(10000);
browser.getAllWindowHandles().then(function(handles) {
browser.switchTo().window(handles[1]);
browser.driver.sleep(sleep);
browser.driver.getCurrentUrl().then(function(url){
expect(url).toBe(baseUrl + "about/");
});
browser.close();
browser.switchTo().window(handles[0]);
});
});
我得到的错误如下:
Message:
Failed: Parameters were incorrect. We wanted {"required":["name"]} and you sent []
我想我有这个,因为没有其他窗口只有当前窗口。因为click()事件没有发生。我不知道为什么会这样。它甚至可以在Android chrome上正常工作。
有什么想法吗?
由于