Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Salesforce · Agentforce Specialist

Testing Agents, Preview, Testing Center

Agentforce Specialist · Lesson 11 of 14 · 1:35:34

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Salesforce Agentforce Specialist exam. In this lesson: the preview and its two modes, the Interaction Summary, session tracing, batch tests in the Testing Center (CSV or AI-generated cases), test cases and evaluations, the rules of testing in a sandbox, and Agentforce DX and the Testing API. Includes three original practice questions, with Sunmeadow Solar, a fictional solar installer, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of December 2026.

A few good conversations

Sunmeadow's portal agent handles a few conversations well in the preview. But a few conversations prove very little. Before customers see it, the admin needs to know how it behaves across hundreds of questions, and that is what this lesson covers.

The preview

Testing starts in the preview of Agentforce Builder, one conversation at a time. Simulate mode uses simulated data and actions, while Live Test uses real data. For each reply, the Interaction Summary shows the steps, the subagent that was chosen, and the reasoning. So when an answer looks wrong, this is the first place to see why.

Session tracing

Agentforce Session Tracing goes deeper, and logs every step of a session under its session ID. That includes each run of the reasoning engine, the actions, the inputs and outputs of prompts, errors, and the final response. It requires Data 360. And after launch, the same tracing shows what real users actually ask.

Batch tests

The Testing Center runs dozens or hundreds of test cases at once, in parallel, grouped in a test suite. It used to live in Setup, and it is now the Tests tab of Agentforce Studio. Test cases come from a CSV file, or AI generates them from the agent's subagents and actions, with the number of cases, the goal, and the share of positive and negative cases. A good set has volume, diversity, and quality.

Inside a test case

Each test case has a user utterance, and what you expect in return. That means the expected subagent, the expected actions, and the expected outcome, written in natural language. The results show expected against actual, with a pass or a fail for each case. And a failed case can be replayed in the preview, to see the path the agent took.

Built-in evaluations

Besides the subagent and the actions, evaluations score the response itself. Coherence checks that it is easy to understand and free of errors, and completeness checks that it holds all the essential information. Conciseness checks that it is brief but complete, and latency measures the response time in milliseconds. You can also set context variables, such as the language of the session, and a conversation history.

Newer and custom evaluations

Newer versions let you edit cases in a grid, and keep a history of runs. Conversation tests simulate whole conversations with personas, such as a frustrated customer, and score them on whether the task was resolved. A custom evaluation states a criterion in natural language, with a scale and a pass threshold. A language model then acts as the judge, and scores each response against that criterion.

Rules for testing

Run tests in a sandbox only, because they consume requests and credits, and can change data in the org. Results are probabilistic, since one input can have several good answers, so each company sets its own pass threshold. A useful reference is the accuracy a person reaches on the same task. When a test fails, rephrase the instructions, check the data and permissions, split the actions, or add guardrails.

Three ways to test

There are three ways to run these tests. The Testing Center is the interface, with test cases from a CSV file or from AI. Agentforce DX uses the command line and test specs in YAML, so tests run in continuous integration, and a failing suite can block a deployment. The Testing API defines tests as metadata, with up to a thousand cases, and up to ten runs in progress at once.

Recap

Let's recap. The preview tests one conversation, and the Interaction Summary and session tracing show why the agent did what it did. The Testing Center runs test suites in bulk, from a CSV file or from AI. Each case sets the expected subagent, actions, and outcome, and a failure is replayed in the preview. Evaluations score coherence, completeness, conciseness, and latency, and custom evaluations add your own criteria. Test in a sandbox, set your own threshold, and choose the Testing Center, Agentforce DX, or the Testing API.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. In the preview, a warranty question is answered by the wrong subagent. Where should the admin look first to see why?

    • The Setup Audit Trail
    • The Interaction Summary of the preview
    • The Agent Analytics dashboard
    • The model provider settings
    Show the answer

    The Interaction Summary of the preview

    The Interaction Summary of the preview shows the subagent that was chosen, and the reasoning behind each step. “The Setup Audit Trail” is wrong, because the Setup Audit Trail tracks configuration changes, not how a conversation was routed. “The Agent Analytics dashboard” is wrong, since Agent Analytics shows trends across many sessions, not the path of one reply. And “The model provider settings” is wrong, because the model provider settings decide which models are allowed, not which subagent was chosen.

  2. A test case fails: the expected action was Get Record Details, but the agent ran Query Records. What should the admin do FIRST?

    • Delete the failing test case
    • Run the suite again in production
    • Change the expected action to match
    • Replay the utterance in the preview
    Show the answer

    Replay the utterance in the preview

    Replaying the utterance in the preview shows the path and the reasoning that led to the other action. “Delete the failing test case” is wrong, because deleting a failing case hides the problem without understanding it. “Run the suite again in production” is wrong, since tests belong in a sandbox, not in production. And “Change the expected action to match” is wrong, because changing the expectation to match the result makes the test pass, but proves nothing.

  3. The admin wants to run three hundred test cases against the portal agent. Where should the suite run, and why?

    • In production, to test with real customer data
    • In production, since sandboxes cannot run tests
    • In a sandbox, since tests use credits and change data
    • Anywhere, since tests never change any data
    Show the answer

    In a sandbox, since tests use credits and change data

    Tests consume requests and credits, and can change data, so a sandbox is the place to run them. “In production, to test with real customer data” is wrong, because testing in production risks changing real customer records. “In production, since sandboxes cannot run tests” is wrong, since sandboxes are exactly where tests are meant to run. And “Anywhere, since tests never change any data” is wrong, because tests can change data, through the actions the agent runs.