> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/buildabot/emulator.md).

# Emulator

Test your bot from your canvas to make sure it works as expected.

When your bot does not behave as expected, you need to investigate and identify the issue—also known as debugging. But where should you start? How can you determine the cause of the problem? This article covers the basics of debugging inside the Chatlayer Emulator.

## Test your bot in the Emulator

To open your Emulator:

1. Under the [**Bot builder**](https://docs.chatlayer.ai/navigation/bot-builder.md) tab, click on [**Flows**](https://docs.chatlayer.ai/navigation/bot-builder/flows.md).
2. Find the **play** button in the upper right corner of the screen and click on it.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FiTCdNkCH45UBuszMpW1H%2FScreenshot%202024-07-11%20at%2009.49.59.png?alt=media&amp;token=28999dd9-349a-40e8-b54f-582ebfbaf1a1" alt="" width="339"><figcaption><p>Open the Emulator by clicking on the play button in the upper-right corner of your canvas.</p></figcaption></figure>

3. Test your bot by typing in the input field.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FUfqZ0AHgZhZgaNlNyH79%2FScreenshot%202024-07-11%20at%2011.44.42.png?alt=media&amp;token=a618c244-fa7b-4fe9-88ec-97be488abe48" alt="" width="375"><figcaption><p>Test your bot in the Emulator.</p></figcaption></figure>

4. To restart the test conversation, click on the **restart** button at the top right corner of the window.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2Fe2quFpmgFl43XbQoPss9%2FScreenshot%202024-07-11%20at%2015.31.38.png?alt=media&amp;token=9c9c9f49-c64e-46e3-83f7-50986faea377" alt="" width="375"><figcaption></figcaption></figure>

## Test modes

Your Emulator has 3 different modes of testing that can be set from the upper part of the window.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FwxXwtt5rbJhPIp5GLF6w%2FScreenshot%202024-07-11%20at%2015.22.23.png?alt=media&amp;token=0f153e95-a812-4a5e-b796-1cae37a49067" alt="" width="375"><figcaption><p>3 available modes of testing inside your Emulator.</p></figcaption></figure>

### Debugger

This is useful if you would like to debug your chatbot. For a most comprehensive guide to debugging, check this page:

{% content-ref url="/pages/-LbwglccNy56zkITA7QE" %}
[Debug your bot](https://docs.chatlayer.ai/support/solving-bot-issues.md)
{% endcontent-ref %}

### Voice

This is the mode to test your voicebot if you have one.

{% content-ref url="/pages/bTkWmYB7tYjzfCt3QXjK" %}
[Test your voicebot](https://docs.chatlayer.ai/voice/phone-and-voice/test-your-voicebot.md)
{% endcontent-ref %}

### WhatsApp Sandbox

This is a test window to [test your bot on a WhatsApp channel](https://docs.chatlayer.ai/start-quickly/leadzy-tutorial/1.-new-bot-new-block#run-tests-in-the-whatsapp-sandbox).

## Debug your bot

To debug your bot conversation:

1. Click on **Debugger** next the bubble chat.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FD6GaeVVo1JyAwWZmu7Iz%2Fdebug.png?alt=media&amp;token=41eb3e17-4a19-475d-8be5-c6c5f5a78a41" alt="" width="375"><figcaption><p>Click 'debug' icon to open the debugger modal</p></figcaption></figure>

2. An **Inspector** window opens. In this Inspector, you can check the user [**Session data**](https://docs.chatlayer.ai/bot-answers/session.md).

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FcUoOmH98ziOXaJcGQLNr%2FScreenshot%202024-07-16%20at%2009.56.05.png?alt=media&amp;token=04207ad4-ed25-48f3-9a81-c27db79184a3" alt="" width="563"><figcaption><p>Test emulator with debugger side modal</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chatlayer.ai/buildabot/emulator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
