【问题标题】:How to run automated Selenium test with Headless Chrome browser?如何使用 Headless Chrome 浏览器运行自动化 Selenium 测试?
【发布时间】:2017-05-12 19:27:13
【问题描述】:

目前在 Selenium webdriver 上运行的所有自动化测试,有没有办法用新的 Headless chrome 运行所有这些测试?

【问题讨论】:

  • 我相信 Chrome 团队仍在开发 chromium-headless Chrome 浏览器。

标签: google-chrome selenium-webdriver selenium-chromedriver


【解决方案1】:

是的,Chrome V60+ 可以做到这一点。添加这 2 个chromeOptions 就大功告成了:

chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--disable-gpu");

【讨论】:

    【解决方案2】:

    是的,您可以使用新的 Headless chrome 运行所有这些。您需要使用 chrome 版本 59 并添加两个 chromeOptions 以在 selenium 中使用 headless chrome

    这里是代码

    https://www.automation99.com/2017/07/how-to-use-chrome-headless-using.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-27
      • 2021-01-14
      • 1970-01-01
      • 2019-11-08
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 2010-09-17
      相关资源
      最近更新 更多