configuring clover with selenium

Hi ,

Please some body can share configuration of clover with a web app .

after instrumenting the source code how to deploy instrumented  code to a webserver (say tomcat) and run selenium tests against it and find code coverage .

it will really helpfull if some one can provide step by step instructions for a sample web app

1 answer

1 accepted

0 votes
Accepted answer

Please have a look at these guidelines:


The exact setup depends on whether you want to collect global code coverage only (i.e. from all tests executed) or do you want to collect per-test code coverage as well (i.e. to be able to track coverage from every single single selenium test).

I recommend to start with the global coverage only as it's easier to set up. Steps:

1. Instrument code with Clover. The best is to have one clover.db as it will be easier to copy (use singleCloverDatabase=true or use absolute path to clover.db to create one database). Also use the 'interval' or 'threaded' flushPolicy.

2. Copy clover.db file to web server. If you have many clover.db files, then you must keep their relative location (e.g. gzip and unzip all of them).

3. Start your application server with -Dclover.initstring=/path/to/clover.db parameter if you have one database or -Dclover.initstring.basedir=/path/to/all/clover.db/folder if you have many databases.

4. Run tests.

5. Stop the server, especially if you did not change flushPolicy (i.e. 'directed' is used).

6. Copy clover.db* files (these are coverage recording files) back to build server (put in the same folder where clover.db is located), run clover:clover to generate reports.


If you succeed, then you can configure per-test coverage as a next step. In order to achieve this, you have to run with 'clover.server=true' flag, see the manual linked above for more details.

Thanks Marek . It works fine .

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Jan 15, 2019 in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

270 views 4 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you