Sub topic 9
Creating a test suite in the Testing Center
This chapter assumes you know what Agentforce topics and actions are. It also assumes you can open Setup in an org where Agentforce and the Testing Center are enabled. You will build a small suite in the UI and learn where people usually go wrong.
What a suite is
A test suite is a named group of test cases that run together against one agent. Each case holds an utterance, an expected topic, expected actions, and an expected outcome. You design the cases first (see the previous chapter on test design). Here you enter them.
Steps in the UI
The exact labels can vary by release, but the flow is stable.
- Open Setup and search for Testing Center, or open it from the Agentforce Studio area.
- Choose to create a new test. Pick the agent to test. Use the agent version you plan to ship, not an old copy.
- Give the test a name and a description. The name becomes the API name, so use a pattern such as
Order_Support_Agent_Tests. - Add test cases. For each one, enter the utterance, choose the expected topic, choose the expected actions, and type the expected outcome.
- Save the test. It now exists as a definition in the org and is ready to run.
You can also upload a CSV file of cases instead of typing them. The next chapter covers spec files.
A worked example
Suppose the agent has an Order_Status topic with a Get_Order_Status action, and an Off_Topic topic for everything else. Two cases cover the main path and an out-of-scope request.
| Utterance | Expected topic | Expected actions | Expected outcome |
|---|---|---|---|
| Where is my order 1001? | Order_Status | Get_Order_Status | The agent tells the customer the current status of the order. |
| What is the best pizza recipe? | Off_Topic | none | The agent politely declines and explains what it can help with. |
Leave the actions empty on the second case. An empty list asserts that the agent calls no action, which is the behavior you want for out-of-scope requests.
The flow at a glance
Common errors
- Wrong names. The expected topic or action does not match the developer name in your agent. The case fails even though the agent behaved well.
- Vague outcomes. "The agent helps the user" passes almost anything. State what a correct reply must say or do.
- Only happy paths. A suite with no out-of-scope or edge cases misses routing mistakes.
- Testing the wrong version. If you edit the agent after creating the suite, check that the suite still points at the version you intend.
- Too many actions listed. Expected actions should be the ones the request truly needs. Extra entries make the case brittle.
Check your work
Before you move on, open the saved suite and confirm three things. The case count matches what you planned. Every case names a topic from your agent. Every out-of-scope case has an empty action list.
Exercise
Your suite has a case for "What is the best pizza recipe?" with expected topic OffTopic, but you listed GetOrder_Status as an expected action. What is wrong, and how do you fix it?
Show answer
An out-of-scope request should not trigger any action, so listing GetOrderStatus asserts the wrong behavior and the case will fail on a correct agent. Remove the action so the list is empty, and keep the outcome as a polite refusal.
Exercise
Why is it better to pick topics and actions from the picker than to type their names?
Show answer
The picker shows the exact developer names in your agent. Typed names can contain typos or use labels instead of developer names, which causes failures that come from the test and not from the agent.