Hands-On Chatbot Development with Alexa Skills and Amazon Lex
上QQ阅读APP看书,第一时间看更新

Testing your skills

Now that we've built and deployed our new Alexa Skill, we need to test it out and see whether it works. At the top of the page, there are four tabs: Build, Test, Launch, and Measure. We've finished with Build, so we can click on Test. Click the toggle at the top of the page to enable testing for this skill:

Test screen

To interact with your new skill, you can either type your messages or click and hold the microphone button and talk to your computer like you would with Alexa. To test your skill by talking to it, you will need a microphone on your laptop or PC, and have allowed the web page to access that microphone. As soon as you hit Enter or let go of the microphone button, you'll see Alexa loading and then she'll reply with your intent and add the message to the chat window. As well as the response from Alexa, you also get information in the Skill I/O section of the screen. If the intent was successfully triggered, you'll get the full JSON Input that is sent to your Lambda as well as the response that it has given:

Working hello test

This is what you should get when you chat with your bot. Make sure that you are saying the correct utterances.