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
ChizChiz 

Test coverage % vary in browser and IDE. Where is exact numbers?

Hi all,

When you hit Run All Tests in browser it shows code coverage for all classes in yuor org. When you hit Run Tests on classes folder in IDE it will do the same. BUT results will be different. Why?

I have class x with ONE method. In IDE it shows 100% coverage and in browser 73%. Where is the truth???

Starz26Starz26

There is an issue with force or the IDE.... check your coverage within force.com and you will probably see it is trying to cover comments and blank lines.

 

To resolve, simply clear your test history and rerun the test in force.com and the coverage will return to as you expected...

ChizChiz

What is "clear history"?

Starz26Starz26

Under APEX Test runner, select View History and the Clear History.

 

Then rerun your tests.

ChizChiz

Sorry. But I can't find this options.

What do you mean when say "under"? I can find "Clear" button "under" Apex Test Runner tab in IDE. But I can't find any any "View History"/"Clear History" menu/button.

Please point me.

Starz26Starz26

In SFDC

 

Your Name -> Setup -> Develop -> Apex Test Execution -> View Test History -> Clear Test Results

 

Then rerun your tests.

ChizChiz

OK. Now it almost the same in Force.com and IDE. It have just 1-2% difference. But where is exact numbers? In Force.com or IDE?