ApexTestResultLimits

Captures the Apex test limits used for a particular test method execution. An instance of this object is associated with each ApexTestResult object. Available from API version 37.0 or later.

Supported SOAP API Calls

create(), delete(), describeSObjects(), query(), retrieve(), update()

Supported REST API HTTP Methods

Query, GET

Fields

Field Name Details
ApexTestResultId
Type
reference
Properties
Create, Filter, Group, Sort
Description

The ID of the associated ApexTestResult object.

AsyncCalls
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of asynchronous calls made during the test run.

Callouts
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of callouts made during the test run.

Cpu
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The amount of CPU used during the test run, in milliseconds.

Dml
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of DML statements made during the test run.

DmlRows
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of rows accessed by DML statements during the test run.

Email
Type
int
Properties
Create, Filter, Group, Sort, Update
Description
The number of email invocations made during the test run.
LimitContext
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description

Indicates whether the test run was synchronous or asynchronous.

LimitExceptions
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description

Indicates whether your org has any limits that differ from the default limits.

MobilePush
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of mobile push calls made during the test run.

QueryRows
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of rows queried during the test run.

Soql
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of SOQL queries made during the test run.

Sosl
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

The number of SOSL queries made during the test run.

Usage

The ApexTestResultLimits object is populated for each test method execution, and it captures the limits used between the Test.startTest() and Test.stopTest() methods. If startTest() and stopTest() aren’t called, limits usage is not captured. Note the following:
  • The associated test method must be run asynchronously.
  • Limits for asynchronous Apex operations (batch, scheduled, future, and queueable) that are called within test methods are not captured.
  • Limits are captured only for the default namespace.