Skip to main content

View Test Results

Learning Objectives

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

  • Describe Agentforce Testing Center test results.
  • Troubleshoot failed 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 Setup, in the Quick Find box, search for and select Testing Center.
  2. Select the Test Name Generated Test Agentforce v1.

At the top of the page you see the following: Status, Duration, Topic Pass %, Action Pass %, and Response Pass %. “Testing Center with Generated Test Agentforce v1 test statuses.”

This section gives you a quick overview of how the different parts of the tests are completed. You can choose to download or rerun the tests. Rerunning the tests is helpful when you’ve made changes to the agent and need to see if modifications cause the current tests to fail. You can then add new tests to the CSV test file to cover the updates made to the agent. Finally, you can create a new test with the updated test file and run the new tests.

The next section on the page is Test Results. Here, you can use a dropdown to select one of the three options: All Results (the default), Passed Results, and Failed Results.

“Test results as described above.”

The Test Results section displays ten columns. Let’s look at the first line in more detail.

Utterance

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

Expected Topic

MigrationDefaultTopic

Actual Topic

MigrationDefaultTopic

Topic Test Results

Pass

Expected Actions

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

Actual Actions

['IdentifyRecordByName', 'ExtractFieldsAndValuesFromUserInput']

Action Test Result

Fail

Expected Response

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

Actual Outcome

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

Outcome Test Result

Pass

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

  • Actual Topic shows which topic was chosen for the utterance.
  • Topic Test Result shows Pass or Fail if the actual topic matches the expected topic.
  • Actual Actions shows which actions the agent ran from the topic.
  • Action Test Result shows Pass or Fail if the actual action matches the expected actions.
  • Actual Outcome shows the actual response from the agent.
  • Outcome Test Result shows Pass or Fail if the actual outcome matches the expected response.

It looks like the first 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 topics, 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 Agentforce Builder center screen shows the results, including Session Start, User Prompt, Select Topic, and so on.

””

You also see Select Action, 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 Center 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.

The Agentforce Testing Center 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 Center 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

Comparta sus comentarios de Trailhead en la Ayuda de Salesforce.

Nos encantaría saber más sobre su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios en cualquier momento en el sitio de Ayuda de Salesforce.

Más información Continuar a Compartir comentarios