From the course: Robot Framework Test Automation: Level 1 (Selenium)

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Break the script into keywords

Break the script into keywords

In this video, we're going to take our original script and we're going to break it up into keywords. The reason why we're going to do this is that, as we've seen in the previous video, keywords can be reused by multiple test cases. It also improves our understanding of script intention when we're able to read those natural language keywords instead of a bunch of Selenium2 keywords and selectors. And finally, it's going to improve our ability to decipher test results, both when everything passes, and also help us isolate failures more quickly when something fails. So how do we do this? We're going to take the original script, we're going to add some line breaks and comments to the script to determine which steps go together. Then we're going to create a keyword to represent the section under each comment. Then we will move the lines from under each comment to its respective keyword. Let's give it a try. So here's our original script. And as you recall, I've got a whole bunch of test…

Contents