Page 1 of 1

JSCoverage with automated scripts

Posted: 2012-01-10 7:44 am
by 4nit
I want to test the code coverage for one of the website. I have instrumented the javascripts and able to get the code coverage information using jscoverage.html. We have 100s of automated scripts (QTP scripts) to test the functionality and wanted to run all of them and get the code coverage at the end.
How can i integrate the jscoverage into these scripts ?

Re: JSCoverage with automated scripts

Posted: 2012-06-07 10:46 pm
by tessarakt
I adapted the approach from http://mercenary-code.blogspot.com/2010 ... enium.html .

The basic idea is to load run a HTML page and its scripts in a browser with Selenium WebDriver. Then a small script (the one used in that blog post is overly complicated, JSON.stringify() rules) hands the coverage information to the driver code, which can output in a well-known format (for CI integration), or just do whatever it likes to do.

There also is the jscoverage-server - I have not tried it, but you perhaps should take a look.

HTH,

Jens