Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC

Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC

Hi,

I want to JS code coverage done by my Selenium Test Suite

Is there any code coverage tool which can be integrated with my existing selenium rc framework??

like image 443
Abhinav Garg Avatar asked Feb 29 '12 08:02

Abhinav Garg


People also ask

Can I use JavaScript with Selenium?

Selenium is an open-source automation testing tool that supports a number of scripting languages like C#, Java, Perl, Ruby, JavaScript, etc.

Which of the following applications can interact with Selenium?

Selenium can test web applications against browsers like Firefox, Opera, Chrome, and Safari, to name a few. The test code can be written in various programming languages like Java, Perl, Python, and PHP.

What is js code coverage?

Code coverage provides information about whether, and optionally how often certain parts of an application have been executed. It's commonly used to determine how thoroughly a test suite exercises a particular codebase.


1 Answers

In theory, you can use any coverage tool that instruments JavaScript code to collect coverage data.

For example, you can use JSCoverage either in proxy mode (for real-time instrumentation) or for static instrumentation to run your Selenium tests off the instrumented code.

One technical hurdle could be to devise a way to accumulate coverage data across multiple pages. The coverage tool of your choice could already have support for accumulation of data from multiple page runs. If not, you might have to handle that bit yourself, but this is probably not something trivial.

like image 169
Ates Goral Avatar answered Oct 16 '22 10:10

Ates Goral