selenium - 如何在 Selenium WebDriver 3 中最小化浏览器窗口

标签 selenium selenium-webdriver

通过 driver.manage().window().maximize(); 最大化窗口后,如何使用 Java 最小化 Selenium WebDriver 中的浏览器窗口?

最佳答案

好像有minimize function现在:
从文档中:
webdriver.manage().window()

this.minimize() → Promise<undefined>
Minimizes the current window. The exact behavior of this command is specific to individual window managers, but typicallly involves hiding the window in the system tray.

Parameters
None.

Returns
Promise<undefined>
A promise that will be resolved when the command has completed.

所以代码应该是:
webdriver.manage().window().minimize()
至少 in JavaScript .

关于selenium - 如何在 Selenium WebDriver 3 中最小化浏览器窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42647058/

相关文章:

python - Selenium 中的简单文件上传片段适用于 Chrome,但不适用于我的 Mac 上的 Firefox

c# - Selenium ChromeDriver 在构建服务器上返回 403 错误

css - WebDriver Selenium:在某些元素之后需要在表中选择元素

python - 无法单击 selenium python 下拉菜单中的列表项

python - 运行使用远程 Webdriver 并连接到 selenium hub 和节点的测试失败

internet-explorer - selenium webdriver IE 按钮问题

python - 如何修复ModuleNotFoundError : No module named 'webdriver_manager'

java - 在 Selenium 网格上创建和上传文件

ruby - 如何使用 Selenium 清除或替换输入字段的内容?

java - Selenium Webdriver - Opera - 无法从渲染器接收消息