UChat Official

Introduction

Welcome to a new episode in our "101 Mondays" series! Today, we're diving into a crucial skill for chatbot developers: debugging your chatbots effectively using test users.

Whether you're facing unexpected behaviors, message failures, or errors in your subflows, mastering this technique can save you hours of troubleshooting.

This guide provides a step-by-step walkthrough on how to leverage test users to identify and resolve issues within your chatbot's flow, ensuring a smoother user experience and more reliable bot performance.

Understanding and Implementing Test Users for Debugging

What is a Test User?

A test user is a specially designated user account within your chatbot platform that allows you to monitor every interaction during a conversation. When marked as a test user:

  • Every step they take in the flow is tracked node by node.

  • You can observe errors and see detailed logs.

  • It’s akin to activating a full debug mode for that user.

This method is invaluable for identifying issues such as:

  • Messages not sending

  • Users ending up on unintended paths

  • Errors in subflows or action nodes

Why Use Test Users?

  • Precise debugging: pinpoint where the flow breaks

  • Error diagnosis: see exact error messages

  • Flow validation: ensure the chatbot behaves as expected

  • Time efficiency: quickly locate and fix issues

How to Add and Use a Test User

Step 1: Select the User

  • Navigate to the User Overview section.

  • Choose the user you want to designate as a test user.

  • Copy the User NS (User Identifier).

Step 2: Mark the User as a Test User

  • Go to the Tools menu.

  • Select Tester.

  • Add the copied User NS to the list of testers.

Step 3: Prepare Your Subflow for Testing

  • Open your subflow.

  • Review and prepare your test scenario.

  • Use the Preview button to simulate user interactions.

Step 4: Run the Test and Observe

  • Initiate the test scenario.

  • Interact with your chatbot as a user would:

    • For example, click buttons, send messages, or choose options.

  • During the test, the platform tracks each node the user passes through.

Step 5: Check Error Logs

  • After testing, go to Tools > Error Logs.

  • Use the search feature to locate your test user.

  • Review the detailed logs:

    • Each node the user visited

    • Any errors encountered

    • Error messages and descriptions

Step 6: Analyze Errors

  • Click on specific nodes to directly jump to the problematic point.

  • For example, if an error states "message content is empty", inspect the node responsible for sending notifications.

  • Open the live chat to see real-time error icons and messages.

Practical Example: Debugging a Chatbot Flow

Imagine a scenario where a user interacts with your bot:

  • Starts with a "Start" node.

  • Chooses between "Menu" or "Talk to Agent".

  • The flow proceeds to a smart delay before completing.

Scenario Walkthrough:

  1. Test User Initiates Interaction:

    • Clicks "Show Menu".

    • The bot responds with options.

  2. User Selects "Talk to Agent":

    • Sends a message "Hi".

    • The bot assigns an agent and sends a notification.

  3. Error Encountered:

    • The notification message is empty.

    • Error logs show "message content is empty".

    • Live chat indicates "messages empty" icon.

How the Debugging Helps:

  • The logs reveal which node failed.

  • You identify that the notification message was not properly set.

  • Fix the message content in the relevant node.

  • Remove the test user after debugging to prevent clutter.

Key Tips for Effective Debugging

Tip

Description

Remove test users after debugging

Prevent logs from cluttering your system.

Use descriptive error messages

Make troubleshooting easier.

Test multiple scenarios

Cover different user paths for comprehensive debugging.

Regularly review logs

Catch issues early before deployment.

Document fixes

Keep track of common issues and solutions.

Summary Table: Debugging Workflow with Test Users

Step

Action

Purpose

1

Select user in User Overview

Identify the user to test

2

Mark user as a test user

Enable detailed tracking

3

Run the chatbot flow

Simulate user interaction

4

Review error logs

Detect errors and problematic nodes

5

Analyze specific node errors

Pinpoint exact issues

6

Fix issues in flow

Correct errors identified

7

Remove test user

Clean up after debugging

Final Thoughts and Best Practices

Mastering test user debugging is essential for building reliable chatbots. It provides granular insights into user interactions, enabling you to quickly identify and fix issues. Remember:

  • Always remove test users after debugging to keep logs clean.

  • Use detailed error messages to facilitate troubleshooting.

  • Regularly test different scenarios to ensure robustness.

  • Keep your flows well-documented for easier maintenance.

By integrating this debugging approach into your development process, you'll save time, reduce errors, and enhance user satisfaction. If you have questions or need further clarification, don't hesitate to ask in the comments. Happy debugging!