7.1 Testing an Agent with Testing Center

Key Takeaways

  • Testing Center batch-tests agents across many scenarios and supports turn-level and conversation-level tests.
  • Running tests consumes requests and credits, and testing agents can modify CRM data, so Salesforce recommends using Testing Center only in a sandbox.
  • You can generate up to 200 test cases at a time from subagents and actions or from knowledge sources, or upload a CSV with up to 1,000 tests per file.
  • Turn-level CSV columns include a required Utterance plus optional Expected Subagent, Expected Actions, Expected Response, conversation history, and context variables.
  • Agentforce Builder offers Simulate mode, which doesn't change org data, and Live Test mode, which runs real actions, along with a Trace panel for debugging.
Last updated: September 2026

7.1 Testing an Agent with Testing Center

Quick Answer: Agentforce Testing Center runs batch tests that simulate many conversations with your agent at once and score the results. Build a test suite, add test cases by generating them from subagents and actions, generating them from knowledge sources, or uploading a CSV, choose scorers, and run. Because AI agents are non-deterministic, broad batch testing catches problems that one-at-a-time preview misses. Run tests in a sandbox: tests consume credits and can modify CRM data.

Why Batch Testing Is Required

LLM-based agents can respond differently to similar inputs, so a handful of manual chats doesn't prove readiness. Testing Center helps you:

  • Evaluate response accuracy, conversation quality, subagent recognition, action execution, and knowledge retrieval at scale
  • Surface patterns and edge cases that small-scale testing misses
  • Catch regressions after changing instructions, actions, or knowledge
  • Build evidence for a deployment decision

Salesforce's testing strategy guidance says to define agent success before you test. Tie the test plan to outcomes your organization tracks, so you don't measure what's easy and quietly redefine success.

Two Places Testing Center Appears

New Testing Center in Agentforce Studio (Beta)Legacy Testing Center in Setup
TestsAgents (simulated conversations) and prompt templates (batch inputs)Agents
InterfaceSpreadsheet-style grid with scorers, test history, inline editingSetup-based test runs
Permissions to create testsManage Agentforce Grids AND Manage Agentforce TestingManage AI Agents plus the permissions for your agent type
AutomationTesting Center API and Agentforce DXMetadata API test definitions and CLI

The concepts (test cases, expected subagents and actions, scorers) are the same in both.

Test Scope: Turn-Level vs. Conversation-Level

ScopeWhat a test case representsDefault scorers
Turn-levelA single utterance and the agent's responseResponse Evaluation, Subagent Assertion, Action Assertion
Conversation-levelA scenario a simulated user follows across multiple turns (up to 20 turns per uploaded conversation)Task Resolution, Subagent Evaluation, Actions Evaluation

Conversation-level tests can use customer personas that simulate background noise, natural conversation flow, accents and phonetic spelling, incomplete information, and verification issues. Output can be text only or text and voice, with an audio recording of the simulated call. Employee agents support text outputs only.

Test Conditions

ConditionOptions
Data Access ModeLive data runs against your active environment, including real CRM data, actions, and external connections; use it for final pre-deployment sign-off. Mocked data runs in an isolated environment with no external calls or org changes; use it while iterating. Conversation-level testing doesn't support mocked data
Conversation historyAdds a column for prior turns, as a JSON array of role and message pairs
Context variablesAdds a column per selected field, such as Lead Name, to simulate realistic context. Conversation-level testing doesn't support context variables

Three Ways to Build Test Cases

1. Generate from subagents and actions

  • Select the subagents to test and enter a description that focuses the test theme.
  • Generate up to 200 test cases at a time, drafted in the agent's default language.
  • The generator reads subagent and action instructions and writes utterances designed to trigger each subagent and action. Results confirm whether the agent selected them.
  • AI can generate test cases for Account, Lead, Opportunity, and Contact. For custom objects or Answer Questions with Knowledge, include specific guidance and sample utterances in the description.
  • The description is for focus and scope only. Don't include a test count, a specific subagent name, or phrases like "generate test cases."
  • Strategy: test all subagents for a baseline, only changed subagents after an update, or a cluster of related subagents (such as order status, cancel, and modify) for end-to-end journeys.

2. Generate from knowledge sources

  • Available when the agent is connected to a Data Library based on Knowledge articles and fields or uploaded files. Custom retriever and web libraries aren't supported.
  • Produces question-and-answer style tests from that content, up to 200 at a time.
  • Supports turn-level testing only.

3. Upload a CSV

Download the template for your chosen scope and conditions, fill it in, and upload it (up to 1,000 tests per file).

Turn-level columnRequired?Notes
UtteranceRequiredThe user input
Expected SubagentOptionalUsed to evaluate routing
Expected ActionsOptionalA Python-style list, for example ['GetRecordDetails', 'SummarizeRecord']
Expected ResponseOptionalA reference response used to score output. Write the actual expected reply, not instructions about it
Conversation HistoryOptionalA JSON array of prior turns
Context Variable [Field]OptionalOne column per selected variable

Conversation-level CSVs use a required Conversation column (a plain-language scenario description) plus optional expected actions, expected subagents, history, and context variables.

Tip: Download AI-generated test cases as CSV, refine them, and re-upload. That's faster than writing everything by hand.

Manual Testing in Agentforce Builder

Batch testing complements, but doesn't replace, manual testing:

ModeBehaviorUse it for
SimulateVerifies configuration without changing your data or org; can use mock dataEarly iteration on logic and instructions
Live TestRuns the actions and changes your orgChecking real behavior before activation

The Trace panel is the reasoning debugger. It shows selected subagents, triggered actions, subagent transitions, and variable value changes. The Interaction Summary shows subagent selection, action execution, and reasoning, and you can ask the Agentforce assistant to explain any step. You can test drafts, committed, active, and inactive versions.

Loading diagram...
A practical agent testing loop

Other Testing Center Facts

  • Multi-agent solutions: an Agent Handoff Evaluation column shows whether the orchestrator handed off to the expected connected subagent (Pass or Fail).
  • Automation: the Testing Connect API offers endpoints to start a run, get status, and get results (.../einstein/ai-evaluations/runs), using test definitions deployed through Metadata API. Agentforce DX can also run agent tests from the CLI.
  • Prompt templates: the new Testing Center batch-tests a template version across uploaded inputs with scorers such as coherence, completeness, factuality, and instruction following.
  • Generation time: generating tests can take from a few minutes to several hours. Refresh the suite to see test cases.

Exam Traps

  • Testing Center isn't "safe by default." Live tests can modify CRM data, so use a sandbox.
  • Knowledge-source generation is turn-level only and needs a Knowledge or file library.
  • Expected Response must be the answer itself, not "the agent should be polite."
  • Simulate mode doesn't change data; Live Test mode does.
Test Your Knowledge

Why does Salesforce recommend running Agentforce Testing Center only in a sandbox?

A
B
C
D
Test Your Knowledge

A team wants Testing Center to generate question-and-answer tests from the content in the agent's Knowledge-based data library. Which limitation applies?

A
B
C
D
Test Your Knowledge

In a turn-level test CSV, how should the Expected Actions column be formatted?

A
B
C
D
Test Your Knowledge

A developer wants to check agent logic repeatedly without changing any org data or calling external services. Which option fits best?

A
B
C
D