Loading

Code is not highlighted in the Developer Console post test class execution

Udgivelsesdato: Jun 25, 2026
Beskrivelse

When running a test class in the Salesforce Developer Console, code coverage highlighting may not appear after test execution. In the Developer Console, covered lines are highlighted in blue and uncovered lines are highlighted in red. If these highlights do not appear after running tests, the cause is typically a setting in the Apex Test Execution options that disables detailed coverage tracking.

Løsning

Root Cause

This issue occurs when the Store Only Aggregate Code Coverage option is enabled in the Apex Test Execution settings. When this option is checked, Salesforce stores only a summary of code coverage data — not the detailed, line-by-line coverage required to display highlighting in the Developer Console. Disabling this option allows Salesforce to store the granular coverage data needed for the highlighting feature.

How to Enable Code Coverage Highlighting

  1. From Setup, search for and select Apex Test Execution in the Quick Find box.
  2. Click the Options button.
  3. Uncheck Store Only Aggregate Code Coverage if it is currently checked.
  4. Click OK to save.
  5. Re-run your test class.
  6. Open the Apex class in the Developer Console — code coverage highlighting (blue for covered, red for uncovered) will now appear after the tests complete.
Vidensartikelnummer

000386084

 
Indlæser
Salesforce Help | Article