Code coverage for Selenium Tests



  • Is there any tool available to determine the code coverage for my selenium tests?

    My tests are written in Java having use of selenium WebDriver with BDD-Cucumber implementation in it.



  • Finally, this solution works for me --

    1. Instrument the Istanbul.js.
    2. Use Command - istanbul instrument test.js >> test-instumented.js

    3. Now, use the below code in @AfterClass annotation. It will execute the below method after all tests.

    AfterClass Implementation 4. Now, we have coverage.json.

    1. Crete a HTML using coverage,json using istanbul report.


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2