You need to sign in to do that
Don't have an account?
Pawan Kumar 32
Displaying Code coverage of Apex class on VF page
Hi All,
I want to display code coverage of apex class on VF page using apex coding(programmatically). for e.g. if apex class abc1,abc2,abc3... have code coverage 60%,75%,85%.. respectively then I should be able to display the code coverage(60%,75%.85%..) on VF page xyz. I have also used ApexCodeCoverage object. But I am not able to display the code coverage on vf page. Please help me.
Thanks in Advance..
I want to display code coverage of apex class on VF page using apex coding(programmatically). for e.g. if apex class abc1,abc2,abc3... have code coverage 60%,75%,85%.. respectively then I should be able to display the code coverage(60%,75%.85%..) on VF page xyz. I have also used ApexCodeCoverage object. But I am not able to display the code coverage on vf page. Please help me.
Thanks in Advance..
Hope this helps!
Thanks
Prady01
https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexcodecoverage.htm
Go to above link and see Usage section. The object "ApexCodeCoverage" comes in Salesforce Tooling API, hence you may need to do a callout here.
HTH,
Suraj
The object "ApexCodeCoverage" is not native to Salesforce API, it comes under Force.com Tooling API. You need make a web service callout to your own org to access it.
Try the below code in Dev Console.
Make sure the version in right when you are using this query in workbenck. The body will give you all the details you need this will be json format and also make sure you have the right remote site settings in the Org with the right call Back URL.
Hope this Helps!
Prady01