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

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…

Contents