Newer Version Available
ApexTestResult
Supported Calls
create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
Special Access Rules
The enableApexTestReqViewSetup field on the ApexSettings metadata type controls the activation of the critical update “Require View Setup permission to access Apex test data”. In API version 49.0 and later, when the field is set to true, users must have the View Setup and Configuration permission to access this object.
Fields
| Field Name | Details |
|---|---|
| ApexClassId |
|
| ApexLogId |
|
| ApexTestRunResultId |
|
| AsyncApexJobId |
|
| Message |
|
| MethodName |
|
| Outcome |
|
| QueueItemId |
|
| RunTime |
|
| StackTrace |
|
| TestTimestamp |
|
Usage
You can query the fields of the ApexTestResult record that corresponds to a test method executed as part of an Apex class execution.
Each test method execution is represented by a single ApexTestResult record. For example, if an Apex test class contains six test methods, six ApexTestResult records are created. These records are in addition to the ApexTestQueueItem record that represents the Apex class.
Each ApexTestResult record has an associated ApexTestResultLimits record, which captures the Apex limits used during execution of the test method.