Web Automation Using Selenium
  • About The Book
  • Selenium
    • Introduction
      • What is testing and why?
      • What is Selenium and Why?
    • Getting Started
      • Audience
      • Prerequisite
      • Set up
      • Getting Started - Hello World..!!
      • What are drivers
    • Locators
      • CSS Selectors
      • XPath Selector
    • WebDriver
      • WebDriver Methods
      • WebDriver Types
    • WebElement(s)
      • WebElement Methods
      • Looping Through WebElements
    • Waits In Selenium
  • TestNG
    • Introduction
    • TestNG Setup
    • First Test Script
    • Some of the features of TestNG
    • TestNG Annotations
      • @Test
      • @DataProvider
  • Maven
    • Introduction
  • Framework Development
    • Introduction
    • Building Framework
      • Technology Stack
      • Page Object Model (POM)
      • Setup
      • What our framework contain
      • Packages
        • Context
        • Factory
        • Listeners
        • Pages
      • Creating first automation test
  • Common Interview Questions
    • Selenium-Related
Powered by GitBook
On this page

Was this helpful?

  1. Framework Development
  2. Building Framework
  3. Packages

Pages

PreviousListenersNextCreating first automation test

Last updated 2 years ago

Was this helpful?

This package will contain all the page object classes that we'll be needing for our test case. You can read more about page objects .

One important thing we need to take care is that all of our page classes should extend BasePage.java with webdriver instance as constructor argument. So the page factory is initialized. Which means The WebElement variables of our class are initialized with a proxy object by selenium.

Since all of our page classes extend BasePage it makes a very good place to initialize other required objects of selenium such as waits, actions etc., which require webdriver instance. So that we don't have to initialize them multiple times and all of these will be available in all sub classes.

We can also have some utility methods in BasePage such as double click, context click etc., so we don't have to rewrite the logic of these multiple times.

here