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
rmranjith8881.3927046400771116E12rmranjith8881.3927046400771116E12 

Unit Test is Passed but Code Coverage remain 0%?

Hi All,


I wrote a Test class for 2 Triggers in Sandbox,

Earlier it covered 92%, before refreshed my Sandbox, and again when I Run my Test It is showing 0%, even though Test is passed.

I don't know why code coverage is 0%?

Can you please help me out?

Thanks in Advance...............

Best Answer chosen by rmranjith8881.3927046400771116E12
rmranjith8881.3927046400771116E12rmranjith8881.3927046400771116E12
Thank God!!!

I Found the Solution for this.

When I am Deploying to Production, I am not activated my Trigger, thats why Code coverage not showed, after Activating the Trigger, It Successfully Deployed and Working fine in Production.

Thanks to Harish Narayanan.
 

All Answers

Harish NarayananHarish Narayanan
Did you change anything in the test class when ran it the 2nd time? Post some screenshots.
rmranjith8881.3927046400771116E12rmranjith8881.3927046400771116E12
Thank God!!!

I Found the Solution for this.

When I am Deploying to Production, I am not activated my Trigger, thats why Code coverage not showed, after Activating the Trigger, It Successfully Deployed and Working fine in Production.

Thanks to Harish Narayanan.
 
This was selected as the best answer