[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
siliconforks.com • View topic - Can I integrate jscoverage with automation framework.

Silicon Forks » Forum

It is currently 2019-11-19 2:04 pm

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 2010-07-08 6:42 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
We have automation framework written using selenium. I want to find out code coverage for our automation framework. I see jsCoverage does give code coverage report but you always have to start by accessing jscoverage.html. Can we avoid this?

Ideally I want to do this...
1. Start code coverage measurement.
2. Run the automation framework.
3. See the code coverage reports.

If possible, there should not be any manual interaction involved in performing above three steps.

Regards,
Amit


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-08 4:16 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
You may want to look at , which describes a method of getting coverage data from Selenium tests without using jscoverage.html.


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-09 4:48 am 
I'm very new to jsCoverage. I have written my selenium tests in java. Can you please tell me what libraries I need to import in my java project so that I can use jsCoverage functions like jscoverage_report().

Do I need to use window mode? If yes, How do we use window mode? Detailed steps will be appreciated.

Regards,
Amit


Top
  
Reply with quote  
PostPosted: 2010-07-09 10:58 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-10 10:01 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
I have followed all the three steps as mentioned above. Instrumented code on my server and run tests on this code. Also called same function as mentioned below on test completion but did not see any code coverage report.

Some debugging showed that jscoverage_report is returning null everytime.
If I run same test operation manually and try to access code coverage report through jscoverage.html; everything is working fine.

Am I doing anything wrong?
Do I need to run jscoverage-server program even though I am running tests on instrumented code?


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-10 5:23 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
Don't call the jscoverage_report function - that won't be available. What you want to do is generate a custom report, using the code above. Just the code above is all you need to generate the report.


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-11 6:58 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
Ed,
Thanks for your help. I'm able to generate reports in text format.

What do I need to do to generate exactly same reports that I get by manually using jsCoverage program.

Basically I want my reports to show following fields at least...
1. js File Name.(Already displayed.)
2. Code coverage -- Total lines, lines executed.
3. Link to the source code files with non-covered source code lines highlighted.


Regards,
Amit


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-12 2:17 am 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-13 6:36 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
Thanks a lot Ed. I'm able to generate reports with your code.

The only problem I'm facing is I'm not able to merge results coming from different tests. Is there any way I can acheive this?


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-13 9:56 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
Depending on your test suite, you may be able to change the Selenium run mode to *firefoxproxy to get the coverage from your entire test suite. Note that some tests may not work with *firefoxproxy. See for details on different Selenium run modes.


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-16 7:39 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
Thanks Ed. Actually lot of my test cases do not run with *firefoxproxy option. Anyways I have added merge logic to my code which gets executed in @aftertest.

All the results are getting merged properly and I'm also getting reports. But if I click on js fileName I could not see the source code. It is just displaying the name of file.

I have copied 6-files mentioned by you from JSCoverage source distribution. Am I missing something here?


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-16 9:58 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-17 4:48 am 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
Yes. I'm getting error in console as for json file as "not well formed".

But I get this error when I open jscoverage.html file itself. Then I deleted this error and clicked on file name link. But this error is not reported again in Error console.

I have re-checked my json contents for me they are well formed. Here is example.
{"img/images.css.js":{"coverage":[null,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}}


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-17 11:48 am 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120


Top
 Profile  
Reply with quote  
PostPosted: 2010-07-18 3:16 pm 
Offline

Joined: 2010-07-08 6:30 am
Posts: 9
Actually when I tried to generate coverage report by firing jscoverage_report() function from firebug, I got report which has exactly same json file format as I have entered in my previous comment.

The only difference is that filename has following format...

http://serve_name/js/Startup2_all.js?v=100625130026

I do not see any source code line in this json file but it displays me contents for source code.

Is it absolute necessary to have source code array along with coverage array OR can I reference the source code without adding source code?

Regards,
Amit


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group