Unit testing the Child bot

This is an optional step before we build the Parent bot. We can unit test the Child bot and check if it is sending the messages as intended. To do so, follow these steps:

  1. Let's add two log messages so that we can check whether the bot sent the message successfully or not. We will add these within the If and If Else conditions we added in the previous section. Add two Log to file actions and point them to a text file. This is where we'll be storing log messages. Your log messages can be in one of the following formats: 
    • For success (Within an If condition): $System:Machine$ - INFO - Message Successfully sent by Child Bot
    • For failure (Within an If Else condition): $System:Machine$ - INFO - Message send failed in Child Bot:

  1. Next, go ahead and Run the Child bot from the top menu. The A2019 Control Room should appear and provide you with input boxes, as shown in the following screenshot. Provide your values from the Twilio console for the obfuscated areas. Note that in the URI, the obfuscated area is the Twilio account SID. SenderPhoneNumber is the trial number from Twilio, while ReceiverPhoneNumber can be any of your Twilio validated caller IDs:

If all goes well, the Child bot should run successfully and your log file will have an entry stating that the message was sent successfully by the Child bot. You should also receive an SMS on your phone with the message that you sent. 

Now that the Child bot is ready and we can send messages with it, let's create the Parent bot.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.172.233