【问题标题】:Controlling Chrome coverage feature with chromedriver使用 chromedriver 控制 Chrome 覆盖功能
【发布时间】:2018-03-22 21:32:28
【问题描述】:

目前有没有办法在 Chrome 在 selenium 或其他自动控制软件下运行时以编程方式从 Chrome 中提取覆盖率报告?

【问题讨论】:

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


    【解决方案1】:

    通过查看this article,在 cmets 中有一个参考,即目前无法导出此数据,但有 a feature request

    还有另一篇文章 here 讨论了该功能的工作原理,并且在 cmets 中有人提出了同样的问题。响应是有一个 API here,也许您可​​以利用 Chrome 扩展程序。

    【讨论】:

      【解决方案2】:

      现在,Selenium 只能通过 execute_script 访问浏览器上下文,旨在执行 window.__coverage__; 以收集前端的覆盖率数据。因此,您需要使用 nyc 检测源代码并解析返回值。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-06-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-20
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多