【发布时间】:2022-06-10 19:57:27
【问题描述】:
我正在编写 selenium IDE 脚本,并希望在无头模式下运行烟雾测试时以无头模式运行脚本以执行其他操作
我该怎么做?
【问题讨论】:
标签: selenium phantomjs selenium-ide automation-testing selenium-side-runner
我正在编写 selenium IDE 脚本,并希望在无头模式下运行烟雾测试时以无头模式运行脚本以执行其他操作
我该怎么做?
【问题讨论】:
标签: selenium phantomjs selenium-ide automation-testing selenium-side-runner
看看下面,有更详细的定义。希望你能得到答案。
https://code.tutsplus.com/tutorials/headless-functional-testing-with-selenium-and-phantomjs--net-30545
https://www.qafox.com/new-selenium-ide-chrome-browser-headless-mode-using-command-line-runner/
【讨论】:
尝试在您的驱动程序参数中指定如下所示。
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
WebDriver driver = new ChromeDriver(options);
【讨论】:
你可以添加一个配置文件,默认名称是 .side.yml
这是我的配置文件的示例:
capabilities:
browserName: "chrome"
goog:chromeOptions:
args:
- no-sandbox
- disable-dev-shm-usage
- headless
- nogpu
【讨论】: