Jacoco report shows 0 % for selenium scripts

72 views
Skip to first unread message

RamaP

unread,
Jun 29, 2016, 7:39:45 AM6/29/16
to JaCoCo and EclEmma Users
I want to add jacoco coverge for selenium functional test cases using ANT

Our selenium scripts are bundled as an executable jar. So, I have added <jacoco:coverage> for <java.../> as below. I get a report but it shows 0% coverage. The selenium functional scripts run on a tomcat URL which is configured using properties and added to jar classpath. 

Can someone help me out in getting the correct coverage. 

<target name="run_selenium">
<jacoco:coverage>
<java jar="${myapp.dir}/seleniumscripts.jar" dir="${myapp.dir}/target" fork = "true" failonerror="true" maxmemory="256m">
<jvmarg line="-DjacocoArgs=-javaagent:${jacoco.home}/lib/jacocoagent.jar=destfile=${myapp.dir}/target/jacoco.exec"/>
</java>
</jacoco:coverage>
<jacoco:merge destfile="${myapp.dir}/target/merged.exec">
<fileset dir="${myapp.dir}/target" includes="jacoco.exec" />
</jacoco:merge>
<jacoco:report>
<executiondata>
<file file="${myapp.dir}/target/merged.exec" />
</executiondata>
<structure name="PivotMDAP">
<group name="myapp">
<classfiles>
<fileset dir="${myapp.dir}/classes"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${myapp.dir}/source"/>
</sourcefiles>
</group>
</structure>
<html destdir="${myapp.dir}/target/output" />
</jacoco:report>
</target>

Marc Hoffmann

unread,
Jul 12, 2016, 11:43:50 AM7/12/16
to jac...@googlegroups.com
Hi,

in the HTML report there is a link "Sessions" on the top right corner.

What classes are listed on this page? Are these the classes you expect
to get coverage reported for? Do these class names have links?

Regards,
-marc
> --
> You received this message because you are subscribed to the Google
> Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/57d3d6e1-96d2-460d-ae2c-c305847c82ca%40googlegroups.com
> [1].
> For more options, visit https://groups.google.com/d/optout.
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/jacoco/57d3d6e1-96d2-460d-ae2c-c305847c82ca%40googlegroups.com?utm_medium=email&utm_source=footer
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages