Can I integrate jscoverage with automation framework.

Questions, problems, suggestions, bug reports, and so on.
Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Can I integrate jscoverage with automation framework.

Post by Ed »

The jscoverage.json file should always have the source in it. You can see this in my code post:

http://siliconforks.com/forum/viewtopic.php?p=401#p401

... you can see it is reporting the source for each file in there.
Amit
Posts: 9
Joined: 2010-07-08 6:30 am

Re: Can I integrate jscoverage with automation framework.

Post by Amit »

Ok. Problem of not viewing source code is solved by including source code lines in json object. But when test uses large number of java script files(500-600 in mu case), it results in OOM memory while selenium.geteval call. In general my test used 500-600 js files.

So, do jscoverage have any recommendations for java heap size settings OR it be solved by changing jscoverage javascript function?
Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Can I integrate jscoverage with automation framework.

Post by Ed »

OK, that is a lot of files. :!: Probably if there are that many files then using getEval is not the best way to get the source code.

You could do one of two things to view the source from the report:

1. Write the "source" to the jscoverage.json file from your Java code (not the JavaScript code). What you would have to do is read each .js file (the original, uninstrumented .js file) and write out the lines as a JSON array of strings. Keep in mind this will create a huge jscoverage.json file, though.

2. You could do what you were suggesting above, modify the jscoverage.js file (in the report directory) to get the source code for each .js file when it is viewed. Although if you do that, you may run into web browser security restrictions if you try to use a file:/// URL.
Amit
Posts: 9
Joined: 2010-07-08 6:30 am

Re: Can I integrate jscoverage with automation framework.

Post by Amit »

Ed,

Thanks a lot all the way.
I am able to get complete code coverage report for my application.

Regards,
Amit
agadamsetty
Posts: 1
Joined: 2012-07-18 12:02 pm

Re: Can I integrate jscoverage with automation framework.

Post by agadamsetty »

Hi Amit,

Could you please tell me how you integrated the results of each test and created consolidated report.

I am able to get the code coverage for individual tests, but unable to combine all the test results. I have 100 tests in my suite and we close the browser after every test.

Thanks,
Ashok
Post Reply