gpt4 book ai didi

selenium - 如何在 headless 模式或后台运行 chrome 驱动程序

转载 作者:行者123 更新时间:2023-12-02 01:15:38 25 4
gpt4 key购买 nike

我一直在使用 chrome 驱动程序(带有 selenium webdriver),到目前为止它从未引起任何问题,现在出于某些要求我想在后台运行测试用例。我该怎么做?

最佳答案

目前 Chrome 59 支持 headless 模式。您只需使用那些 chromeOptions 即可在 selenium 中使用 headless chrome。

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

您可以引用以下链接了解更多详情:
https://www.automation99.com/2017/07/how-to-use-chrome-headless-using.html

关于selenium - 如何在 headless 模式或后台运行 chrome 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42801833/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com