Set Up Your DX Environment
Preview and Debug an Agent
Generate an Agent Test Spec
Customize the Agent Test Spec
Create an Agent Test from the Spec
Run Agent Tests
Manage an Agent
Troubleshoot Issues
Reference
This section describes the legacy process for testing Agentforce agents, or the pro-code equivalent to using the Legacy Agentforce Testing Center in Setup. It doesn’t apply to the new agent testing process, or the pro-code equivalent to the New Testing Center in Agentforce Studio (Beta). That documentation will be released soon.
Warning
Testing an agent entails sending it questions, statements, or commands (utterances) and then making sure that the agent behaves as you expected when it responds.
Using Agentforce DX to test an agent is the pro-code equivalent of using the Agentforce Testing Center UI in your development org. As with any software development, testing an agent is an iterative process. Here’s the general flow, and later sections of this guide go into details about some steps.
agent generate test-spec CLI command. A test spec is a local YAML file that describes one or more test cases for your agent.agent test create command, passing it the test spec file. This command also automatically syncs the associated metadata back to your DX project.agent test run command. You can also use the VS Code agent testing panel to view and run the tests.agent preview CLI command to chat with the agent and test the utterances and responses in a conversational way. When using VS Code Agent Preview, you can also easily invoke the Apex Replay Debugger to debug Apex classes that implement actions. Then use all the information you gathered to fine-tune your agent instructions, actions, or subagents.