To load test data using csv file
- johnsontitus
- May 18, 2020
- 1 min read
Save the csv file as a static resource.
In the test class, use the method:
List<sObject> ls = Test.loadData(<ObjectType>.sObjectType,'<name of the static resource>');
To use the data:
for(<sObject> obj : ls){
//code
}

Comments