I am using the belwo querying in Query Editor in Developer Console:

SELECT ApexClassOrTrigger.Name, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate

Enabling the Tooling API like below:

enter image description here

I need to the results of the query in CSV or something to analyze.

When I am running the query in Workbench, I am getting below error:

enter image description here

How can I enale Tooling API in Workbench?


For tooling API you should do a REST Explorer get request.

On utility tab select Rest Explorer select GET.

/services/data/v46.0/tooling/query/?q=SELECT ApexClassOrTrigger.Name, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate

You will get the resuls, But this seems not so friendly, this will not solve your Problem.

enter image description here

To get the .csv of test class

I am using Salesforce advanced Code searcher chrome extiontion which has the very good other option too, Once add to chrome, Reload the Home Page of your org. Click to the second tab you will get the many ways to get the code coverage with download option.

enter image description here

| improve this answer | |
  • Salesforce advanced Code searcher has done the thing. Great tool. – वरुण Sep 20 '19 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.