Skip to main content

View Test Results

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe Agentforce Studio test results.
  • Troubleshoot tests in Agentforce Builder.

Working with Test Results

Once the tests are completed, you can view the results and see what worked well and what didn’t work as well as you hoped. Take a look at the results for the test you ran in the last unit.

  1. From the App Launcher App Launcher icon, search for and select Agentforce Studio.
  2. Click Tests.
  3. Select the Test Suite Generated Test Agentforce v1.
  4. Click Run history.
    Run history shows the Status, Results, and Run By for each time the test suite is run.
  5. Select the Start Time for the test suite that you just ran.

At the top you see the following: Subagent Evaluation Pass %, Action Evaluation Pass %, and Response Evaluation Pass %. This gives you a quick overview of how the different parts of the tests are completed.“Agentforce Studio with Generated Test Agentforce v1 test statuses and Details and Download Results buttons.”

The Test Results section displays several columns. Let’s look at the first line in more detail. Your results might be different.

Utterance

Please update the email address for Ilsa Galgey to new_email@example.com.

Expected Subagent

MigrationDefaultTopic

Expected Actions

['IdentifyRecordByName', 'ExtractFieldsAndValuesFromUserInput', 'UpdateRecordFields']

Expected Response

The email address for Ilsa Galgey has been updated to new_email@example.com.

Agent Response

Can I proceed with updating Ilsa Galgey's email address to new_email@example.com?

Response Evaluation

Pass

Subagent Evaluation

Pass

Actual Subagent

MigrationDefaultTopic

Action Evaluation

Fail

Actual Actions

['IdentifyRecordByName', 'ExtractFieldsAndValuesFromUserInput']

You probably recognize Utterance, Expected Subagent, Expected Actions, and Expected Response from the test file. The new information are the actual responses and results from running the tests.

  • Agent Response shows the actual response from the agent.
  • Response Evaluation shows Pass or Fail if the actual outcome matches the expected response.
  • Subagent Evaluation shows Pass or Fail if the actual subagent matches the expected subagent.
  • Actual Subagent shows which subagent was chosen for the utterance.
  • Action Evaluation shows Pass or Fail if the actual action matches the expected actions.
  • Actual Actions shows which actions the agent ran from the subagent.

It looks like the above example test had a fail for Actual Actions. The Expected Actions has IdentifyRecordByName and QueryRecords and the Actual Actions has only QueryRecords. You use the Agentforce Builder for the Agentforce (Default) agent to troubleshoot the utterance of this test to get a better idea of what the agent is doing.

Troubleshoot with Agentforce Builder

Switch to the Agentforce Builder and manually test the utterance in the Conversation Preview. Using Agentforce Builder in this way is a form of manual testing and lets you dig into the utterance to see the subagents, actions, and responses the agent chooses. Then try changing the utterance to test getting different results.

  1. From Setup, in the Quick Find box, search for and select Agentforce Agents.
  2. Select the drop down for the Agent Name you want to open and select Open in Builder. We’ll continue to look at the Einstein Copilot or Agentforce (Default) agent.

    Agentforce agent list with the Agentforce (Default) dropdown showing Open in Builder highlighted.
  1. In the Conversation Preview, enter the utterance Please update the email address for Ilsa Galgey to new_email@example.com. and click Enter. The agent might ask you to confirm, click Confirm or enter Yes.

The Agentforce Builder center screen shows the results, including Session Started, User Prompt, Subagent Selected , and so on.

You also see Action Launched, which shows the Identify Record by Name (IdentifyRecordByName) action was called.

The Expected Action test criteria was expecting three actions. The failure is due to the wrong expectation.

At this point there are a few options.

  • The first one is to change the test Expected Action to just have the IdentifyRecordByName and ExtractFieldsAndValuesFromUserInput. But there is also the option to change the test Utterance if it was supposed to invoke both actions.
  • Changing the utterance and checking the Actual Actions in the testing results allows you to reiterate over the tests, make changes, and verify that the agent is doing what is expected. The more tests and different test criteria you have, the higher the confidence and trust in the agent there is.
  • Or this could be used as a negative test. Just add another test with the positive test criteria so that the criteria is covered.

Agentforce Testing Benefits

Testing is an essential part of building Agentforce agents. By creating and maintaining detailed positive and negative test criteria, you’re building and maintaining the confidence and trust that your Agentforce agents are bringing to your users and customers.

Agentforce Testing allows for repeated test runs that give you the ability to quickly determine if changes to your agents are having a negative impact on outcomes. You can even create the testing criteria first, run the tests, and then build the new functionality into the agents to get those tests to pass. This is known as test-driven development (TDD) in the coding community, and is a great way to build out new functionality with agents.

You now have a better idea of what the Agentforce Testing can do for you and the different ways you can work with test criteria to ensure your new agents are a sure way to interact with your users and customers. Now, go forth and create some tests!

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback