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.
Demo: Create a page object - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 1 (Selenium)
Demo: Create a page object
So now I'll take you back to the project we're working on. We'll do LandingPage here. So we're going to create a "Load" and verify page loaded and we're going to take those two lines of script and place them in there. In our search for products keyword, we're going to say LandingPage.Load and LandingPage.Verify Page Loaded. So we'll jump over to that other product. And under resources, I'm going to create a new directory called PO for page object. You can see that in my search for products, these are the two lines of script that are going to go into my LandingPage. So in the PO here, I'll say new file, we'll call it LandingPage.robot. And for every Robot Framework file, we need the settings section. And you probably remember that we need the Selenium2Library, so we'll copy that out of the Amazon keyword file and we'll paste it there. We'll put in our keywords section. And as you recall, we needed a load keyword. And we needed to verify page loaded keyword. So the load keyword is…
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
-
-
-
-
-
-
-