PDI · Question #69
What are three ways for a developer to execute tests in an org? Choose 3.
The correct answer is B. Tooling API C. Setup Menu D. Salesforce DX. Developers can execute tests in a Salesforce org using the Setup Menu's Apex Test Execution UI, programmatically via the Tooling API, or through the Salesforce DX Command Line Interface (CLI).
Question
What are three ways for a developer to execute tests in an org? Choose 3.
Options
- ABulk API
- BTooling API
- CSetup Menu
- DSalesforce DX
- EMetadata API.
How the community answered
(16 responses)- A6% (1)
- B88% (14)
- E6% (1)
Why each option
Developers can execute tests in a Salesforce org using the Setup Menu's Apex Test Execution UI, programmatically via the Tooling API, or through the Salesforce DX Command Line Interface (CLI).
The Bulk API is used for inserting, updating, or deleting large volumes of data and is not designed for executing Apex tests.
The Tooling API provides programmatic access to execute Apex tests, making it a common method for Integrated Development Environments (IDEs) and Continuous Integration/Continuous Deployment (CI/CD) pipelines to run tests.
The Setup Menu (specifically 'Apex Test Execution' or 'Apex Test History') provides a user interface for manually selecting and running Apex tests directly within the Salesforce org.
Salesforce DX (SFDX) offers CLI commands, such as `sfdx force:apex:test:run`, to execute Apex tests from the command line, which is essential for local development and automation scripts.
The Metadata API is used for retrieving, deploying, creating, updating, or deleting setup components (metadata) in an org, not for executing runtime Apex tests.
Concept tested: Methods for executing Apex tests
Source: https://help.salesforce.com/s/articleView?id=sf.apex_execute_tests.htm&type=5
Topics
Community Discussion
No community discussion yet for this question.