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
Sathish B 13Sathish B 13 

Green Red color highlight is not working in sandbox test develoer console

Hello Everybody,

Issue : Green/Red highlight is not working in Developer console while testing.

We always use to debug Test class using devoper console. Green Red highlights will help us to find the codes covered and codes not covered. I'm really not sure why it is not working in Sandbox. Could you please help me in figuring it out?
Harish RamachandruniHarish Ramachandruni
Hi,

Can write sample class and write test class for this and go to test class and test it .open sample class and click on code coverage.And clocse all and reopen salesforce.


Thanks,
Harish R.

 
Sathish B 13Sathish B 13
Hell Harish,

Thanks for your suggestion. It is not working. 

In code coverage, there is no 'All ' option at all. Only None option is available. User-added image
Harish RamachandruniHarish Ramachandruni
Hi,

Please add this code and test it :
 
public class TaskUtil {
    public static String getTaskPriority(String leadState) {
        // Validate input
        if (String.isBlank(leadState) || leadState.length() > 2) {
            return null;
        }
            
        String taskPriority;
        
        if (leadState == 'CA') {
             taskPriority = 'High'; 
        } else {
             taskPriority = 'Normal';
        }
        
        return taskPriority;
    }
}


Test Class :

@isTest
private class TaskUtilTest {
    @isTest static void testTaskPriority() {
        String pri = TaskUtil.getTaskPriority('NY');
        System.assertEquals('Normal', pri);
    }
    
    @isTest static void testTaskHighPriority() {
        String pri = TaskUtil.getTaskPriority('CA');
        System.assertEquals('High', pri);
    }
    
    @isTest static void testTaskPriorityInvalid() {
        String pri = TaskUtil.getTaskPriority('Montana');
        System.assertEquals(null, pri);
    }
}

And Click follow imageUser-added image:

Click cookies remove all cookies.
Thanks,
Harish R,
+919676930011.



 
Sathish B 13Sathish B 13
Please check the below image. Even now it is not showing any green highlight. No 'All' option is availble still. User-added image