【问题标题】:webdriverio: running a test with iedriverwebdriverio:使用 iedriver 运行测试
【发布时间】:2017-11-14 08:41:14
【问题描述】:

我已将webdriverio 设置为与 FF 和 Chrome 一起运行,一切正常。

我正在尝试使用http://webdriver.io/guide/services/iedriver.html 运行相同的测试。

它运行第一个url 命令,但在第二次运行时失败。例如:

browser.url('https://facebook.com'); //navigates to facebook
browser.url('https://google.com'); //fails on this line

哪个抛出:

无法导航到http://google.com。这通常意味着一个 调用 COM 方法 IWebBrowser2::Navigate2() 失败。构建信息: 版本:'3.6.0',修订:'6fbf3ec767',时间: '2017-09-27T16:15:40.131Z' os.name: 'Windows 10', os.arch: 'amd64', os.version: “10.0”,java.version:“1.8.0_151”驱动程序信息:driver.version:未知 运行 Internet Explorer

知道为什么以及如何进行这项工作吗?

编辑: 我读过IE11 Selenium WebDriverException: Failed to navigate. (org.openqa.selenium.WebDriverException ...IWebBrowser2::Navigate2() failed 对我不起作用

【问题讨论】:

  • 你可以做一个解决方法,关闭并再次打开标签
  • 这给出了一个不同的错误:Error: A request to switch to a different window could not be satisfied because the window could not be found.

标签: internet-explorer e2e-testing webdriver-io


【解决方案1】:

试试

browser
.url('https://facebook.com') //navigates to facebook
.pause(5000)
.url('https://google.com') //fails on this line

【讨论】:

  • 这给出了一个不同的错误:Error: A request to switch to a different window could not be satisfied because the window could not be found.
  • 这看起来像 webdriver.io 或 selenium 错误。因为你怎么写和我怎么写都是连续打开不同url的正确方式。也花花公子为什么 IE :D 这些错误总是出现在没有人真正使用的 webdrivers 上,比如 safari 或 IE。使用 chrome 或 firefox 就可以了。
  • 另一种选择,您可以尝试创建一个新选项卡,然后使用webdriver.io/api/window/switchTab.html 切换到它。阅读左下角的完整窗口类别。有你需要的一切。
  • 我昨天尝试了切换标签的技巧。它也给出了一个错误(它说它找不到窗口......)。我知道 IE 是……有问题的事实。但是很可惜,我们必须支持IE用户,所以IE的E2E对于查找IE相关的错误非常重要。谢谢:)
【解决方案2】:

尝试将域添加到此处所述的受信任站点:https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/6511#issuecomment-192149766

只需转到 IE 设置->Internet 选项->安全->受信任的站点->站点

【讨论】:

    猜你喜欢
    • 2021-03-20
    • 1970-01-01
    • 2021-10-28
    • 1970-01-01
    • 2018-12-02
    • 2022-07-07
    • 2021-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多