Actions Simulator

The Actions Simulator lets you test your apps 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 app in the Actions simulator

To test your app in the Actions simulator, upload your action package to your Actions project for testing. This updates the "draft" version of your Actions project and lets you test your app before submitting for approval. From there you can use the simulator to test your app. When testing your app the following restrictions apply:

  • Your app is testable for up to 7 days. After 7 days, you have to reupload the action package for testing using the gactions tool or the Dialogflow Actions on Google integrations screen.
  • You can also test with real hardware devices that are logged into the same Google account that you used to create the Actions project.
  • You can only test one app at any time for a given Google account.
  • Your action package must have at least one action declared.
  • When you want to test a production app on a real device, you must disable testing of the draft version of your app. 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 for development and testing.

Test with Dialogflow

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

  1. Click on Integrations in Dialogflow's left navigation, and move the slider bar for the Actions on Google card.
  2. Click on the Actions on Google card to bring up the integration screen and click TEST. Dialogflow uploads your action package to Google's servers, so you can test it in the Actions simulator.

  3. In the Test your Assistant app section of the integration screen, click on the VIEW link to open a new browser for the Actions simulator.

  4. In the Actions Simulator, enter talk to my test app in the Input area of the simulator to test the app. If you have already specified an app name and saved your app information, then you test apps by saying talk to <app 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 Simulator, enter talk to my test app in the Input area of the simulator to test the app. If you have already specified an app name and saved your app information, then you test apps by saying talk to <app name> instead.

Specify an app version

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

  1. If you have previously tested an app, 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 app.

  2. In the version drop-down menu, select the version of your app that you want to test and click DONE. You'll see all of the apps 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 app, click the CHANGE VERSION link to bring up the previous screen.

Configure app access and sharing

You can share your project with other users to give them access testing your app.

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 app 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 app on your personal device or the simulator, disable devices and the simulator from accessing the app 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 apps.

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 app, 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.