【问题标题】:Chrome Instances don't close after running Test Case in Protractor在量角器中运行测试用例后 Chrome 实例不会关闭
【发布时间】:2018-09-27 07:12:09
【问题描述】:

当我多次运行测试时,Chrome 实例不会因为 PC 利用率趋于 100% 而关闭。所以,我必须手动结束 Chrome 实例。有什么办法可以解决这个问题?

解决方案:

chromeOptions: {
  args: ["--disable-gpu"]
},

在配置文件中“Disable-gpu”负责在渲染出现问题时禁用chrome加速(以防失败)。

【问题讨论】:

  • 您是否在 conf 文件中使用了“restartBrowserBetweenTests: true”标志?
  • 请分享您的 protractor.config。
  • chromeOptions: { args: ["--disable-gpu"] } 负责关闭 Chrome 实例。在我的配置文件中,我添加了这个参数,当渲染出现问题时禁用加速。

标签: google-chrome automation protractor


【解决方案1】:

默认情况下量角器会在测试执行后关闭 chrome 实例,除非测试以不可调和的方式失败。所以尝试将你的 protractor.conf.js 设置重置为默认值

【讨论】:

  • 是的,我在我的配置中添加了 chromeOptions: { args: ["--disable-gpu"] },因为 chrome 实例开始自行关闭。
【解决方案2】:

另一个对我们公司每个人都有效的解决方案是从配置文件中删除"--no-sandbox" 参数,从如下所示的行中删除

chromeOptionsArgs = ["incognito", "--window-size=1920,1080", "disable-extensions", "start-maximized", "--no-sandbox", "--test-type=browser"];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-29
    • 2019-05-13
    • 2016-10-03
    • 1970-01-01
    • 2018-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多