# Emulator

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.&#x20;

## Test your bot in the Emulator

To open your Emulator:

1. Under the [**Bot builder**](https://docs.chatlayer.ai/navigation/bot-builder) tab, click on [**Flows**](https://docs.chatlayer.ai/navigation/bot-builder/flows).
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&#x26;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.&#x20;

<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&#x26;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&#x26;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&#x26;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="../support/solving-bot-issues" %}
[solving-bot-issues](https://docs.chatlayer.ai/support/solving-bot-issues)
{% endcontent-ref %}

### Voice

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

{% content-ref url="../voice/phone-and-voice/test-your-voicebot" %}
[test-your-voicebot](https://docs.chatlayer.ai/voice/phone-and-voice/test-your-voicebot)
{% 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:&#x20;

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&#x26;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).

<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&#x26;token=04207ad4-ed25-48f3-9a81-c27db79184a3" alt="" width="563"><figcaption><p>Test emulator with debugger side modal</p></figcaption></figure>
