You need to sign in to do that
Don't have an account?

Test Class Code Coverage Problem
Hi All,
I am having really tough time dealing with Salesforce Test classes.
My first problem is when I write a test class, then the class I am testing does not show up in Overall Code Coverage.
Then when I click on test the class does show up in Class Code Coverage and show me the coverage % but when I click on it it opens without the colors telling me which line is covered and which is not.
Please let me know how to resolve this.
Thanks.
A quick solution for this :-
Open class in developer console, edit and save. Now class will show up in overall code coverage and we can see the colors that shows which lines are covered.
This is a bug in Salesforce which is not yet fixed, this is a workaround for the time being.
Thanks.
All Answers
https://success.salesforce.com/issues_view?id=a1p30000000T0kUAAS
Please check if this known issue affects you.
Regards,
Satish Kumar
Hi Puneet,
Salesforce is trying to push the use of the developer console. You can still view the color coded view of your classes to see which lines are covered or not in the developer console.
I also find this highly annoying as the old way was much more useful, but SF is really trying to push the developer console.
After running your tests, you need to select the tests you want to look at and click the 'Developer Console' button. You can then choose the test in the Class Code Coverage tab
check the similar post in below link.
http://salesforce.stackexchange.com/questions/16592/code-coverage-column-for-apex-class-missing
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks,
Subhani,
Salesforce Certified Developer,
www.mydbsync.com
The problem is that the class that I am testing does not appear on Overall Code Coverage Section. It appears in Class Code Coverage Section. When I open it it shows shows coverage but the color indicating which line is covered and which is not (red & blue) is missing. This is happening after winter 14 release.
I am having the same problem, the developer console is seriously lacking as is:
This is really bad. As developers we need to be able to see full overall code coverage for all triggers and classes without having to calculate this ourselves.
What we need:
There must be more people having the same problem, how is this being solved?
Thanks.
A quick solution for this :-
Open class in developer console, edit and save. Now class will show up in overall code coverage and we can see the colors that shows which lines are covered.
This is a bug in Salesforce which is not yet fixed, this is a workaround for the time being.
Thanks.
Hi Puneet,
I am facing same issue in my sandbox environment. In Developer console it is showing some % code covered for particular class but when I try to see which lines are missed then it is not even showing me colored lines. It is showing "Code Coverage :None" .
I tried applying solution you have provided but that also didn't worked for me.
Please help.
Thanks
Urvi
Hi All,
Could please any buddy help me for same issue. I am facing big problem. i want Color code of coverage but i am not getting anybody plz hell.
Plzz save from hell!!!
plz show u r expertise.. :)
Goto setup -> Develop -> Apex Test Execution and click the Options button.
Make sure "Store Only Aggregated Code Coverage" is UNCHECKED
That fixed the issue for me.
I had same issues but non of the suggested solutions seemed to help me. In the end I managed to get the code coverage in the following way:
For me the Test Code Coverage only appears if I run the tests from Setup > Build > Develop > Apex Test Execution > Select Tests..
This way I get both the code highlight and coverage percentage in Developer Console immediately after the tests completes. On the other hand, if I run the tests directly from Developer Console I get non of those.
Miroslav's suggestion did work for me.
The test speeds under Apext Test Execution versus running it in the Developer Console are noticeably different (Apext Test Execution is much slower). Hope this fix this soon ish as this is irritating.
But double-clicking the class name a second time does make them show up.
Got lucky in finding this. Hope it helps others
Cheers
Bill
Below is the apex email service class :-
Below is the test class for the above class for which test coverage is 42%:
Can someone help me to cover at least 75%. Tried a lot, but failed. It will be greatly appreciately.
Thanks in advance
Introducing: Test Class Generator
I have discovered an idea and converted into an app named "Test Class Generator", this use to write test class automatically for your controller, batch and trigger. I won't say it would provide 100% code coverage, but it would definitely help business to save some money.
Right now its not covering all complex scenarios of code, but the upcoming releases would be able to cover it.
Please have a look at it and provide your inputs to make it more sturdy and versed.
https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EFozgUAD