Sonar IT using JaCoCo givess 0% code coverage Sonar IT using JaCoCo givess 0% code coverage selenium selenium

Sonar IT using JaCoCo givess 0% code coverage


Hi I am also in the process of generating code coverage for acceptance test using jacoco. For unit test I am using cobertura and I am able to see the code coverage and unit test report on sonar dashboard.

Now coming to getting code covergae for acceptance test. We run acceptance test using selenium. I am wondering how does jacoco generates code coverage for acceptance test that is run using selenium.

From my guess I think you should mention path for jacocoagent.jar instead of jacocoant.jar. I could be wrong too. If you have found a way of generating code coverage for the test which runs on selenium could you provide the solution


I may be missing it, but I don't see where you're telling the agent where to store the results.

In my ant script, I've got this:

 <jacoco:coverage enabled="${my.coverage.enabled}" destfile="${test.log.dir}/jacoco.exec">

wrapping the junit task. Try defining destfile="${jacocoCoveragePath}/jacoco.exec" and see if that fixes it.