javascript - 错误 : "Command "maximizeWindow"is not yet implemented"using webdriverIO v6

标签 javascript webdriver-io

我在 webdriverIOv5 上有一个项目,我试图将其升级到版本 6。 但是当调用 browser.maximizeWindow() 时,我得到这个错误:

ERROR @wdio/sync: Error: Command "maximizeWindow" is not yet implemented

这是我的演示项目 https://github.com/mareru/webdriverIO-shop-demo .
有人知道如何解决这个问题吗?
我确实在 gitter 上找到了一些类似的引用资料,但根据他们的说法,这应该有效。
我不明白我做错了什么。
谢谢!

最佳答案

maximizeWindow 在 chromedriver 从 json wire 切换到 W3C 协议(protocol)并在几个版本前重新实现时被删除。

确保使用最新版本的 chromedriver。您必须根据 https://webdriver.io/docs/selenium-standalone-service.html#configuration 配置 selenium-standalone 服务在你的配置中 https://github.com/mareru/webdriverIO-shop-demo/blob/master/src/wdio.conf.ts#L95

已在我自己的示例存储库中验证 https://gitlab.com/bar_foo/wdio-cucumber-typescript/-/blob/master/config/wdio.CHROME.conf.ts

关于javascript - 错误 : "Command "maximizeWindow"is not yet implemented"using webdriverIO v6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63854911/

相关文章:

php - 如何从 JavaScript 读取 PHP 变量?

javascript - 限制 json 的结果

javascript - 在 webdriver 中执行的性能影响

javascript - webdriver.io 异步问题 - 单击一个元素,然后输入文本

node.js - 你如何在循环中为不同的浏览器运行 webdriver io 测试?

javascript - 通过单击按钮更改表的绑定(bind)

javascript - 调用 KeyPress 事件而不实际按下键

javascript - 在定制的 for-each 循环中链接回调,同时支持同步和异步函数

javascript - Webdriver.io : isExisting(). then() 不是函数