Skip to main content

Using Excel Sheets to Write Test Cases

Although there are many ways of writing test cases for Botium, there are some good reasons why one would choose Excel for Botium:

  • Everyone knows Excel and how to use it, not only test automation engineers or developers

  • Can be shared with your peers by Email (could be done with Google Sheets as well …)

  • Test/Training data already available in Excel or CSV format

  • Mass-Edits of test cases

The downsides of this are:

  • No generic way for version management as with plain text files, leading to files sent around named BotiumTests_v13.xls, BotiumTests_v13_remarks.xlsx … (Better to use Google Sheets)

  • Not all Botium features are available for Excel files

  • It is not possible to make any changes to the Excel content from within Botium

Using Worksheets

Botium encourages to use separate worksheets for structuring your content. The naming of the worksheets is important. Without any special configuration, Botium will look for

  • Convos in all worksheets with name containing “convo” or “dialog” and not “partial”

  • Utterance lists in all worksheets with name containing “utter”

  • Partial Convos in all worksheets with name containing “partial”

  • Scripting Memory in all worksheets with name containing “scripting” or “memory”

Make sure to meet these conventions in your Excel file.

Convos Format

You can write convos by having two Excel columns as in this example.

Tip:
In the 2-column format, Botium generates test case names based on the sheet name and the line number where the conversation begins. To use custom test case names, switch to the 3-column format.
Also note;
  • Botium requires exactly one header row in your test case file. If there's more or less, your test cases won't work correctly.

  • The names of the columns don't matter.

  • You must have at least one empty row between two test conversations. Without this, your test cases will be merged together.

  • If a test case starts with a message in the Bot column, Botium expects the chatbot to initiate the conversation. However, not all Botium Connectors support this feature.

Utterances Format

You can write utterances lists by having two Excel columns as in this example.

Tip:
  • Botium expects exactly one header row in your test case file.

  • The names of the columns don't matter.

  • To start a new utterance list, put the reference name in the first column and list the user examples in the second column. To make sure Botium uses the utterance lists, you need to Enable Utterance Expansion in the scripting settings.

BotiumScript

  • You can use Botium Scripting in Excel files, using the magic words for utterances, asserters, and basically all other BotiumScript structures:

  • When using multiple asserters on a single response from the Bot, make sure to place all BotiumScript in one cell:

    Tip: You have to add a line break within the cell to add BotiumScript asserters. Usually this can be done by using CTRL + ENTER when editing a cell.
  • If you are asserting on multiple bot responses, separate them into several cells:

  • You can also use utterance lists defined in an Excel file in other file formats:
    #me
    HELLO_UTT
    
    #bot
    Hello, humanoid! How can I help you ?

Uploading the Excel to Botium

  1. Use the Dropzone in the Test Sets menu in Botium to quickly upload the Excel file for the first time. Botium Tools & Settings > Test Sets > Create new Test Set > Drop file

    Once the file has been added, a separate Test Set for further refinement will be created and opened.

  2. When you scroll down on the dashboard you should immediately see the convos and utterances Botium extracted from the Excel file.

Making Changes

  1. Navigate to the Test Cases repository, there you will see the uploaded Excel file in the list with the option to download it. Botium Tools & Settings > Test Sets > Your Test Set > Test Cases > Download

  2. After making offline changes to the Excel file, re-upload it by dropping it into the Dropzone. Remember to click the Save button. Botium will then provide a quick overview of the content identified in the file for upload.

Run Test Cases from Excel file

The Test Set holding your Excel file can now be used as any other test set in Botium:

  • Use the Test Suite to create a project, add a chatbot channel, select the test set, and let the test cases run against this chatbot. The project will enable you to repeat any test session, and to CI/CD Integration .

  • In the Test Results menu, quickly select a chatbot channel and the test set to run a one-shot test session

Importing Test Cases from Excel to Botium

When you link an Excel file to Botium following the steps above, the file is connected, but you can’t edit it directly in Botium—you’ll always have to download and re-upload it for any changes. For deeper integration, you can import the Excel content into Botium instead of just linking it.

This offers several benefits:
  1. You can use Botium's visual test case designer.
  2. The content is converted to text-based test cases, which can be versioned in a linked Git repository.
  3. If a test case fails, Botium can directly highlight the issue, saving you from manually searching through the Excel file.
Note: There is one main downside: As soon as the test cases are imported into Botium, there is no way back. Any changes done to the Excel file won’t be reflected in Botium anymore. From then on the only way to make changes is in Botium.

Convert Excel Upload to Botium

Use the Test Set Splitter to Convert your Excel Test Cases to conversations and utterances which can be edited directly in the Visual Test Case Editor.
Tip: The Test Set Splitter is a tool for splitting up a test set into two pieces for separation of training and test data, mainly for NLU analytics. However, it can also be used for the purpose of converting from Excel format to Botium.

Was this article helpful?

0 out of 0 found this helpful