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 - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 1 (Selenium)
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Overview6m 51s
-
(Locked)
Preview of the final solution6m 9s
-
(Locked)
Style: Procedural vs. Gherkin3m 11s
-
(Locked)
Introducing user-defined keywords5m 20s
-
(Locked)
Break the script into keywords7m 18s
-
(Locked)
Moving keywords to resource files7m 47s
-
(Locked)
Adding setup and tear down5m 36s
-
(Locked)
Overview of page objects7m 47s
-
(Locked)
Demo: Create a page object4m 7s
-
(Locked)
Increase readability using Gherkin7m 43s
-
-
-
-
-
-
-