Botium : How to handle responses from bot prompting using convo file?

48 views Asked by At

Currently I am trying to automate chatbot with directline using botium cli

I am using utterances file for input and output responses from botium but response from bot gives prompting first I need to handle for each utterances

I am trying to add and pause using if condition in below botium.convo.txt file

TC01_GREETING_THE_CHATBOT

#me

#bot textCard CARDS textCard|en-US|Hello, I am your assistant

#bot prompting PAUSE 5000

#begin

#me HELLO_UTT

#bot IF #bot IS prompting PAUSE 15000 ELSE #bot RESPONSES_UTT
#end

I want to handle prompting as it is failing test case without matching the output from utterance file of RESPONSES_UTT

1

There are 1 answers

0
VonC On

Botium scripting does not directly support IF/ELSE conditions in convo files. Instead, it handles conversation flows linearly but offers mechanisms like PAUSE to wait for bot responses.

If your bot is known to send a prompt and then wait for user input before continuing, you can use PAUSE to wait for a specific amount of time. However, this requires you to know the expected delay beforehand, which might not be ideal for dynamic interactions.

Since you are dealing with prompting behavior, instead of trying to implement an IF/ELSE logic within a single convo file, consider breaking down the interaction into multiple convo files or steps within a convo file. Use PAUSE to handle expected delays. For unpredictable delays, consider adjusting Botium's timeout settings to make sure Botium waits long enough for the bot's response.

TC01_GREETING_THE_CHATBOT

#me
HELLO_UTT

#bot
PAUSE 5000
textCard CARDS textCard|en-US|Hello, I am your assistant

#bot
PAUSE 15000
RESPONSES_UTT

After sending HELLO_UTT, a PAUSE is introduced to wait for the bot to process and start its prompt. The expected prompting message is specified after the first PAUSE. Another PAUSE is used to wait for the bot's final response, followed by the expected response pattern RESPONSES_UTT.

If Botium Connector or the testing environment supports it, look into more dynamic waiting mechanisms that wait for specific messages or conditions rather than using fixed pauses.