ApexTestResultLimits

Captures the Apex test limits used for a particular test method execution. An instance of this object is associated with each ApexTestResult object.

Version 

Introduced in API version 37.0.

Supported SOAP API Calls 

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

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, POST, Query

Fields 

ApexTestResultId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Sort

  • Description: The ID of the associated ApexTestResult object.

  • Relationship name: ApexTestResult

  • Relationship type: masterdetail

  • Refers to: ApexTestResult

AsyncCalls 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of asynchronous calls made during the test run.

Callouts 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of callouts made during the test run.

Cpu 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

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

Dml 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of DML statements made during the test run.

DmlRows 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

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

Email 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of email invocations made during the test run.

LimitContext 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Description: Indicates whether the test run was synchronous or asynchronous.

LimitExceptions 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

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

MobilePush 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

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

QueryRows 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of rows queried during the test run.

Soql 

  • Type: int

  • Required: No

  • Properties: Create, Filter, Group, Sort, Update

  • Description: The number of SOQL queries made during the test run.

Sosl 

  • Type: int

  • Required: No

  • 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.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!