---
schema_version: "1"
id: 460e40a6e3d5b718613bcf3cde0e22ac7be21c75d6cadb321dd9c11a861c047e
title: ApexTestQueueItem
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_apextestqueueitem.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apextestqueueitem.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 93391b196d7059f1b25b80b2af3eab00e986f114c25d3cc29fc419026c43c746
description: Represents a single Apex class in the Apex job queue. This object is available in API version 23.0 and later.
---
# ApexTestQueueItem

Represents a single Apex class in the Apex job queue. This object is available in API version 23.0 and later.

This object is available in API version 23.0 and later.

## Supported Calls

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

## Special Access Rules

In API version 49.0 and later, users must have the View Setup and Configuration permission to access this object.

## Fields

| Field Name | Description |
| --- | --- |
| ApexClassId | 
Type

reference

Properties

Create, Filter, Group, Sort

Description

The Apex class whose tests are to be executed.

This is a relationship field.

Relationship Name

ApexClass

Relationship Type

Lookup

Refers To

ApexClass



 |
| ExtendedStatus | 

Type

string

Properties

Filter, Nillable, Sort

Description

The pass rate of the test run.

For example: “(4/6)”. This means that four out of a total of six tests passed.

If the class fails to execute, this field contains the cause of the failure.





 |
| ParentJobId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

Points to the AsyncApexJob that represents the entire test run.

If you insert multiple Apex test queue items in a single bulk operation, the queue items share the same parent job. This means that a test run can consist of the execution of the tests of several classes if all the test queue items are inserted in the same bulk operation.





 |
| ShouldSkipCodeCoverage | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Indicates whether to opt out of collecting code coverage information during Apex test runs. Available in API version 43.0 and later.





 |
| Status | 

Type

picklist

Properties

Filter, Group, Restricted picklist, Sort, Update

Description

The status of the job. Valid values are:

- Holding1
- Queued
- Preparing
- Processing
- Aborted
- Completed
- Failed

1 This status applies to batch jobs in the Apex flex queue.



 |
| TestRunResultId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

The ID of the associated [ApexTestRunResult](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apextestrunresult.htm "Contains summary information about all the test methods that were run in a particular Apex job. This object is available in API version 37.0 and later.") object.





 |

## Usage

Insert an ApexTestQueueItem object to place its corresponding Apex class in the Apex job queue for execution. The Apex job executes the test methods in the class.

To abort a class that is in the Apex job queue, perform an update operation on the ApexTestQueueItem object and set its Status field to Aborted.

If you insert multiple Apex test queue items in a single bulk operation, the queue items share the same parent job. This means that a test run can consist of the execution of the tests of several classes if all the test queue items are inserted in the same bulk operation.