You need to sign in to do that
Don't have an account?
Janardhana Reddy
Code Coverage showing 0% in Production
Hi All,
I am running test classes in my production Org, for some Classes it showing 0% Coverage for some classes it showing 97%.
The same test class tried run in my sandbox it showing code coverage for all classes.
Can any one tell me how to solve this Issue.
I am running test classes in my production Org, for some Classes it showing 0% Coverage for some classes it showing 97%.
The same test class tried run in my sandbox it showing code coverage for all classes.
Can any one tell me how to solve this Issue.
Mostly this is bacause of some validation ,Some required field is there in production but not there in sandbox . So that the test records which are there in testcase will execute without fail in sandbox ,however fail in production.
If any class has 0 % code coverage in production check the related test class and execute that and check the error ,you came to know the issue .
No Error but test classes run indivisually then it shows code coverage in sandbox.
Have you executed the indivisul test class which i sshowing 0 % in production ?
executed in production test class, showing 0% in production.
This nightmare for me from two days.
Please see this reference:
https://developer.salesforce.com/page/How_to_Write_Good_Unit_Tests
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_isTest.htm
Writing proper Unit Tests with the best practices can help alleviate the time and stress involved in the scenario you are describing.
Best of luck.