Testing is a critical part of building with Agentforce. You want your agent to deliver accurate, consistent answers, but writing individual test cases for every question in a knowledge base can be time-consuming and tedious. If your agent relies on static resources like PDFs, FAQs, or other knowledge articles, Agentforce Testing Center can help streamline this process.
In this post, we’ll show you how Agentforce Testing Center lets you auto-generate test cases based on the content that your agent already has access to, effectively turning knowledge into a ready-to-run test suite. This feature streamlines validation, saves developers time, and ensures that your agent is performing as expected.
From knowledge to test cases
Imagine that you are working in a hotel like Coral Cloud Resort, and you have an FAQ loaded in your Agentforce Data Library with answers to common customer questions, such as:
- What time is check-in and checkout?
- Are pets allowed?
- Is there a safe in each room?
Generating individual tests for these questions would be a manual, repetitive task. The good news is that Agentforce Testing Center lets you generate them automatically using the Batch Test button in Agentforce Builder.
Thanks to this feature, you can create a new test suite, select the option to generate test cases based on your agent’s knowledge, and decide how many test cases to produce. The system then extracts questions and answers from the content and creates test cases that you can review and run.
The screenshot below shows the Test Data configuration screen in Agentforce Builder. We’ve selected the “Generate test cases based on knowledge available to agent” option and set the number of test cases to 10, and we can also enter a description with more details.
You might wonder why you need to specify the number of test cases that you want to generate. This is because there can be variation in the way the questions are asked. Users rarely input their questions exactly as written in the FAQ, and only part of the FAQ answer might be relevant in some cases, so having more than one test case per question adds some flexibility.
This automated approach transforms your existing knowledge into structured tests without the need for manual effort. In the screenshot below, you can see the generated test cases loaded in Testing Center, including the utterance, run status, expected response, actual response, and test status for each.
Running and reviewing tests
Once test cases are generated, you can run them to verify your agent’s responses. Each test will show a pass or fail result, making it easy to identify gaps or inconsistencies. This feedback loop helps you improve your agent more efficiently and ensures that your answers are reliable and consistent. Here, we see that our tests have completed and all have passed:
Conclusion
Auto-generating test cases from your Agentforce Data Library makes testing agents faster, easier, and more reliable by significantly reducing repetitive work. Regardless of whether you work with a short FAQ or an extensive set of documentation, this feature lets you focus on improving your agent’s knowledge and capabilities rather than managing tedious test creation. By leveraging Agentforce Testing Center, developers can ensure better coverage, faster validation, and a smoother workflow — all while keeping the agent’s responses accurate and consistent.
Resources
- Documentation: Best Practices for Agent User Permissions
- Documentation: Agentforce Testing Center
- Documentation: Create a Test
- Agentforce Decoded video: Auto-Generate Test Cases for Your Agentforce Agent with Data Libraries
About the author
Alex Martinez was part of the MuleSoft Community before joining MuleSoft as a Developer Advocate. She founded ProstDev to help other professionals learn more about content creation. In her free time, you’ll find Alex playing Nintendo or PlayStation games and writing reviews about them. Follow Alex on LinkedIn or in the Trailblazer Community.