function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yogesh KulkarniYogesh Kulkarni 

Zero code coverage

Hi,
I am running the test class and getting the debug lines printed in the code also, but somehow the code coverage remains 0%. Any guesses why this is happening.

Thanks,
Yogesh
Best Answer chosen by Yogesh Kulkarni
Chandra Sekhar CH N VChandra Sekhar CH N V
Run the test class through the standard UI (Develop--->Apex Test Execution) and then check the developer console.

All Answers

MagulanDuraipandianMagulanDuraipandian
Check the code coverage in Developer Console.

http://www.infallibletechie.com
Chandra Sekhar CH N VChandra Sekhar CH N V
Run the test class through the standard UI (Develop--->Apex Test Execution) and then check the developer console.
This was selected as the best answer
HARI KRISHNAHARI KRISHNA
Hi Yogesh,
Is that test class for Apex Class or Apex Trigger?If it is trigger u may face such problems commonly because of test class code mismatch.Check whether u have given correct input what trigger requires excactly.
Yogesh KulkarniYogesh Kulkarni
As suggested by Chandra Sekhar, when ran the tests from UI it showed up the code coverage and when previously did the same thing from developer console it showed 0% code coverage. Strange but worked!!!
Mike ArthurMike Arthur
Me too, I wasted a lot of time trying to figure out why I was getting zero code coverage when running tests from dev console.  Then I found this thread, ran test from UI and I get 100% coverage.

Is this a bug?  Is it being worked on?
B_BajajB_Bajaj

Hi,

I am still facing the issue. I can see few classes are getting failed and others are running fine still coverage is shown as 0%. Any help will be appreciated. Is there any other reason for this issue?