Activity: Implementing Nested Page Object Instances

  1. Analyze the DOM and layout of the file.
  2. Create a Page Object for the Header section:
package com.beginningselenium.examples.pageobjects;import org.openqa.selenium.WebDriver;import;import org.openqa.selenium.WebElement;public class HeaderPage {     //WebElements     private WebElement home;         ///WebDriver         private WebDriver driver;     //Class Constructor    public HeaderPage(WebDriver driver) {         this.driver = driver; }         // Methods to navigate the header     public HomePage goToHome(){ home = driver.findElement("home"));;     return new HomePage();     } }
  1. Create a Page ...

Get Selenium Fundamentals now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.