Bot Reply Consumed
This asserter is used to verify that all bot replies have been processed. This will make sure that there are no unconsumed bot replies in the processing queue.
Example Botium Script
BOT_CONSUMED
will make sure that there are no unconsumed bot replies
in the processing queue.
My Convo
#me
hello
#bot
hello
BOT_CONSUMED
Unconsumed Bot Reply Count
This will verify that there are unconsumed bot replies in the processing queue. The first argument specifies the expected number of unconsumed replies, which can be a specific number or a comparison, such as 2, =2, >2, etc.
Example Botium Script
BOT_UNCONSUMED_COUNT
ensures that there are unconsumed bot replies
in the processing queue. The first argument specifies the expected number of
unconsumed replies, which can be a specific number or a comparison, such as 2, =2,
>2, etc.My Convo
#me
hello
#bot
hello
BOT_UNCONSUMED_COUNT 2|=2|>2
Other Usage Scenarios - Botium Script
-
Consume All Bot Replies: To ensure that all bot replies are consumed
by the conversation:
#end BOT_CONSUMED
-
Ignore Bot Welcome Messages: Some chatbots send welcome messages
before a real conversation starts. To ignore the first few welcome messages
sent in the first 5
seconds:
#begin PAUSE 5000 SKIP_BOT_UNCONSUMED
-
Expect an Unknown Number of Bot Replies:
- If a chatbot replies with an unknown number of messages, handle this
case as follows:
#me Hello PAUSE 3000 #bot BOT_UNCONSUMED_COUNT >0 SKIP_BOT_UNCONSUMED #me ...
- Or if expecting exactly 5 replies:
#me Hello #end PAUSE 3000 BOT_UNCONSUMED_COUNT =5
Note: The currently processing bot reply is already considered consumed, so if you are expecting a total of 5 replies, you should set the expected number to 4 (BOT_UNCONSUMED_COUNT =4) since one reply is already processed.
- If a chatbot replies with an unknown number of messages, handle this
case as follows: