8

Winter 14 release removed Code Coverage column from list of class and triggers. Did anyone found any (nice) workaround to check Code Coverage of ALL classes?

7
  • 2
    Do you mean a similar list of all classes with their respective code coverage? The only way I've been able to do it is run all tests, then view them in the test tab of the developer console. Mar 12, 2014 at 10:45
  • @SineadCoyle you could post that as an answer, I do think that is as of now the only place to see that info. Mar 12, 2014 at 10:46
  • I rather thought about external script that access SF and return class name + % of code coverage etc. Because as I put in comment to your answer it is not answer for my question. I directly asked for ALL clases Mar 12, 2014 at 11:04
  • 1
    We use this code.google.com/p/force-deploy-with-xml-report-task in our Jenkins build that does something along those lines. But I'm not sure about what happens with completely untouched classes.
    – Keith C
    Mar 12, 2014 at 11:07
  • 1
    @ArturKępczyński I'm not the person who cares if it checks all classes...
    – Keith C
    Mar 12, 2014 at 14:06

8 Answers 8

4

The only way I've been able to do it is run all tests, then view them in the test tab of the developer console.

Test Tab in Developer Console

1
  • 1
    Sorry but this check just and only classes run by test. If you have some class which is not used by any test you don't see it. Mar 12, 2014 at 11:01
4

When i was looking for the same i found few work arounds which will work in chrome

open Dev Console in chrome > settings > more settings >developer Tools > in chrome developer console execute the below code

var data = Ext.getCmp('aggregateCoverageGrid').view.store.data.items;
var datacsv = '';

for (var i = 0, len = data.length; i < len; i++) {
  datacsv += data[i].data.className + ',' +data[i].data.numLines + ',' + data[i].data.percent + '\n';
}

if (!datacsv.match(/^data:text\/csv/i)) {
    datacsv = 'data:text/csv;charset=utf-8,' + datacsv;
}

datacsv = encodeURI(datacsv);


link = document.createElement('a');
link.setAttribute('href', datacsv);
link.setAttribute('download', 'testresults.csv');
link.click();

This exports all the test classes into an excel sheet.

1
  • It should generate classes which are in current view, not all. ExtJS is smart in memory management,
    – Ashwani
    May 18, 2017 at 10:22
2

You can try this Heroku app for it.

Code Coverage Report Generator: The application provides the view of all code coverage from the organization and can generate excel sheet of all code coverage.

https://codecoveragereportgenerator.herokuapp.com/

0
1

We've just released an App on the App Exchange that would help with this. 'Power Tools' is a collection of useful tools for Salesforce Admins and Developers and includes a 'Code Coverage Chart' feature.

The Code Coverage Chart allows you to easily view the Code Coverage of your Apex Classes and Triggers, check what test classes are contributing to their coverage and see how they are impacting the full Org Code Coverage (highlighting those that if fixed would contribute most to the Org Coverage).

For more information on the Power Tools Code Coverage Chart (and the other components), please have a look at the documentation on our website here: http://www.lightsideapps.com/documentation/codecoverage/index.html

You can download the App with a free 30 day trial on the App Exchange here: https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EFoy9UAD

1

You can use the Google Chrome Extension "Salesforce code coverage monitor"!

2
  • Can you expand on this a little, and call out any association that you have with it? Otherwise this could get removed as being a likely case of spam, regardless of wehther it really is or not.
    – Matt Lacey
    Oct 21, 2020 at 2:49
  • The extension works actually pretty nicly. While it claimed to work in lightning it only showed results when in Salesforce Classic on my end.
    – wp78de
    Mar 3, 2022 at 22:29
0

This is the closed answer so far I found to this headache. No idea whether it's addressing your key word 'nice' :)

0

I wonder if it is possible to roll your own, using the RunTestsResult objects. (I'm guessing this would be a popular appexchange package! ;)

0

You can use Aside.io to get an excel report about test coverage from each class and see which lines are covered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .