1

For one APEX class there can be multiple test methods. So each test method showing different code coverage using Tooling API.

Is there any way to calculate the code coverage for APEX class including test classes?

  • execute all the test classes from setup->apex test execution->select tests.. and after the completion of all the test execution you can check the code coverage for your class using developer console with red and blue lines. or you can check the total coverage here setup->apex classes-> select you class. you can see the code coverage field with some % – Safiya PV Apr 12 '17 at 12:00
  • Thanks @blackPerlSAF , I am using Tooling API object to fetch Apex classes using SOQL in JAVA. Need to develop dynamic program to calculate code coverage for APEX class. – Rajshree Jadhav Apr 12 '17 at 13:03
0

Query the ApexCodeCoverageAggregate object to see the aggregated code coverage for your classes and triggers.

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexcodecoverageaggregate.htm

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.