Activity: Implementing Nested Page Object Instances

Before You Begin

Open Chrome and go to https://trainingbypackt.github.io/Beginning-Selenium/lesson_6/activity_6_B-1.html.

Scenario

The Gigantic Store application home page contains three sections: a header, a navigation menu, and a banner that displays information, according to the option clicked by the user. We will model this home page by employing the nested Page Object approach, and we will write an automation script that makes use of the nested Page Objects.

Aim

To implement nested Page Object instances in a web application with different pages, such as a home page and a products page.

Steps for Completion

  1. Analyze the DOM and layout of the https://trainingbypackt.github.io/Beginning-Selenium/lesson_6/activity_6_B-1.html file.
  2. Create a Page Object for the Header section.
  3. Create a Page Object for the Menu section. Import packages such as WebDriver, By, and WebElement.
  4. Create a Page Object for the Banner section. Include methods to read the information on the banner, such as getMainInfo and getSecondaryInfo.
  5. Create a Page Object for HomePage.
  6. Create a Page Object for the Products page. Include methods to navigate the header and read the banner.
  7. Write an automation script that uses the Page Objects that were created. The script should include methods to verify the results in the products page and the home page.
  8. Compile and run the script.

To refer to the detailed steps, go to the Solutions section at the end of this book on Page no. 176.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.160.61