Get Started with Testing Agents
You can use several methods to test your agents. Choose the approach that best fits your workflow and technical requirements.
Feature Name | Access Method | Description |
---|---|---|
Testing API | Code | Direct API access using Metadata API and Connect API |
Agentforce DX | Command Line | Salesforce CLI extension that provides agent testing capabilities |
Testing Center | UI | User interface in Salesforce org for creating and running tests |
This page provides guidance for developers using the Testing API or the Agentforce DX CLI. To learn about the Testing Center, see Agentforce Testing Center in Salesforce Help.
To test agents, you must have Agentforce enabled with at least one agent active. See Set up Agents in Salesforce Help.
Agent testing is available only in sandboxes. Note that running tests consumes requests and credits and can modify data.
This diagram shows the high-level workflow for creating, deploying, and running tests:
Each step in the workflow can be completed using multiple methods:
- Create Tests: Build tests programmatically using Metadata API or Agentforce DX.
- For Metadata API, see Build Tests in Metadata API.
- For Agentforce DX, see Generate a Test Spec in Agentforce DX.
- Deploy Tests: Deploy tests using Metadata API or Agentforce DX.
- For Metadata API, see Build Tests in Metadata API.
- For Agentforce DX, see Create an Agent Test with Agentforce DX.
- For a walkthrough on deploying tests via the CLI (using both Testing API and Agentforce DX), see Deploy and Run Tests in the Command Line.
- Run Tests: Execute tests using Connect API or Agentforce DX.
- For Connect API, see Run Tests in Connect API.
- For Agentforce DX, see Run Agent Tests with Agentforce DX.
- For a walkthrough on running tests via the CLI (using both Testing API and Agentforce DX), see Deploy and Run Tests in the Command Line.