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
Keith McRaeKeith McRae 

Test class using Test.loadData to load profile records

I am trying to create a test class that loads Profile records from a static resource:

@isTest(SeeAllData=false)
public class BatchScheduleOnUserTest {

    static testmethod void test() {
        List<sObject> profilesList = Test.loadData(Profile.sObjectType, 'BatchScheduleOnUserTestDataProfiles');
    }
}

This results in an error:
--- START ---
System.NoAccessException: Insufficient Privileges: You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
--- END ---

Am I able to load Profile records in this manner?

Keith