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
Excel File Structure
- Download an example file without explicit test case names (2 columns)
- Download an example file with explicit test case names (3 columns)
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.
- Download an example file with explicit test case names (3 columns)
-
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
-
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
-
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. -
When you scroll down on the dashboard you should immediately see the convos and utterances Botium extracted from the Excel file.
Making Changes
- 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
-
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.
- You can use Botium's visual test case designer.
- The content is converted to text-based test cases, which can be versioned in a linked Git repository.
- If a test case fails, Botium can directly highlight the issue, saving you from manually searching through the Excel file.