【问题标题】:How do I run my Selenium IDE test cases in headless mode?如何在无头模式下运行我的 Selenium IDE 测试用例?
【发布时间】:2022-06-10 19:57:27
【问题描述】:

我正在编写 selenium IDE 脚本,并希望在无头模式下运行烟雾测试时以无头模式运行脚本以执行其他操作

我该怎么做?

【问题讨论】:

    标签: selenium phantomjs selenium-ide automation-testing selenium-side-runner


    【解决方案1】:

    看看下面,有更详细的定义。希望你能得到答案。

    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/
    

    【讨论】:

      【解决方案2】:

      尝试在您的驱动程序参数中指定如下所示。

      ChromeOptions options = new ChromeOptions();
      options.addArguments("--headless");
      WebDriver driver = new ChromeDriver(options);
      

      【讨论】:

        【解决方案3】:

        你可以添加一个配置文件,默认名称是 .side.yml

        这是我的配置文件的示例:

        capabilities:
          browserName: "chrome"
          goog:chromeOptions:
            args:
              - no-sandbox
              - disable-dev-shm-usage
              - headless
              - nogpu
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-02-15
          • 1970-01-01
          • 2014-05-07
          • 2011-02-08
          • 2023-01-22
          相关资源
          最近更新 更多