Actions simulator

The simulator in the Actions console lets you test your Action through an easy-to-use web interface that lets you simulate hardware devices and their settings. You can also access debug information such as the request and response that your fulfillment receives and sends.

Test an Actions project

The simulator allows you to test the console's current version of your Action package. You can upload the latest version of your Action package using the Dialogflow console or, if you're using the Actions SDK, with the gactions tool.

When testing your Actions project, the following restrictions apply:

  • Your Action is testable for up to 30 days. After 30 days, you have to reupload the Action package for testing.
  • You can also test with real hardware devices that are logged into the same Google account that you used to create the Actions project.
  • Your Action package must have at least one Action declared.
  • When you want to the production version of an Action on a real device, you must disable testing of the draft version of your Action. See Disable and enable testing for more information.
  • If testing on hardware, you can also test on any supported hardware device (Android 6.0+, iOS 9.1+, and voice-activated speakers). The device must be logged into the same Google account you're using in the Actions console.

Test with Dialogflow

Dialogflow generates and uploads an Action package to your Actions project automatically when you test it. To test your Action:

  1. Make sure the Web & App Activity, Device Information, and Voice & Audio Activity permissions are enabled on the Activity controls page for your Google account.
  2. Click on Integrations in the Dialogflow console's left navigation.
  3. Click on the Google Assistant card to bring up the integration screen and click TEST. Dialogflow uploads your Action package to Google's servers, so you can test the latest version in the simulator.

  4. In the Actions console simulator, enter "talk to my test app" in the Input area of the simulator to test your Action. If you have already specified an invocation name and saved your invocation information, you can start the conversation by saying talk to <invocation name> instead.

Test with the Actions SDK

  1. Upload your Action package to your Actions project with the following gactions command:

    gactions update --action_package PACKAGE_NAME --project PROJECT_ID
    
  2. In the Actions console simulator, enter talk to my test app in the Input area of the simulator to test your Action. If you have already specified an invocation name and saved your invocation information, you can start the conversation by saying talk to <invocation name> instead.

Specify a project version

You can specify the Actions project version that you want to test (either submitted or draft versions). To select the project version:

  1. If you have tested your Action previously but it's not active in the simulator, click the START TESTING button to see a list of valid versions that you can test.

    You won't see a START TESTING button if you have never uploaded an Action package to your Actions project. If you see the screen below, see Test with Dialogflow or Actions SDK for more information on how to upload and test a new Action.

  2. In the version drop-down menu, select the version of your Actions project that you want to test and click DONE. You'll see all of the versions that you've submitted in addition to a Draft version, which signifies the current state of your project before submission.

  3. To change a version while testing an Action, click the CHANGE VERSION link to bring up the previous screen.

Configure access and sharing

You can share your project with other users to give them access to test your Action.

Share access to your project

  1. Click the share icon at the top right of the simulator:

  2. Follow the instructions on the screen:

Disable and enable testing

When you are testing a draft version of your Actions project in the simulator, that version is invoked instead of the one in production by default. If you want to test the production version of your project on your personal device or the simulator, disable devices and the simulator from accessing the draft version you're testing.

To do this, click on the device (laptop and mobile device) icon at the top right of the simulator:

Specify surface attributes

The simulator can mimic specific surface attributes such as the method of input that users used, their device type, language, and location. This lets you test surface-specific logic and features such as different dialog flows and response types.

Select a surface

The following list describes the available surfaces and the valid input types associated with them.

  • Voice-activated Speakers - Voice only
  • Phone - Touch, Voice, Keyboard

You can select the input method from the input drop-down menu. The default setting is auto-detect and detects whether you use the mic, type in your response, or click on a response in the simulator. Based on the surface you select, input types are also disabled and enabled accordingly.

You receive the input method in every request to your fulfillment in the RawInput object as an inputType field.

{
  "createTime": "2017-10-02T15:01:23.045123456Z",
  "inputType": "TOUCH",
  "query": "This is the spoken, typed, or touched input from the user"
}

Select a language

You can select a locale from the drop-down menu to set the language and region that you want to simulate. See the localization documentation for more information on creating multi-language Actions.

Set a location

You can manually set the coordinates and address of the device. This lets you test any location targeting features that you've set in the console and region-specific responses that you've done in your fulfillment.

To obtain the simulated location for use in your Action, you still have to use the user information helper to ask the user for permission to access it.

Toggle simulator audio playback

Click the audio icon at the top-right of the simulator to toggle audio on and off.

Test transactions in a sandbox

Click the dollar sign icon at the top-right of the simulator to toggle sandbox testing of transactions. When enabled, payment methods are not charged. See the transactions documentation for more information.

JSON debug information

The debug tab shows the actual payload sent by the Google Assistant to your fulfillment in the assistantToAgentJson object (see the request reference documentation) and the response from your fulfillment in the agentToAssistant object. (see the response reference documentation).

To copy the debug information to your clipboard, click on the clipboard icon at the top right of the JSON debug information panel.