Class BasePageObject

java.lang.Object
com.version1.pageobjects.BasePageObject

public abstract class BasePageObject extends Object
This class is a base that all page objects can inherit from. It ensures that we have a WebDriver object at the very least, and also takes care of initiating all of the annotated (@FindBy) WebElements that are declared in page objects as fields. The constructor of this class is called in every page objects constructor that inherits from this class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.openqa.selenium.support.ui.WebDriverWait
     
    protected org.openqa.selenium.WebDriver
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BasePageObject(org.openqa.selenium.WebDriver webDriver)
    Initiates page elements that are declared as fields annotated @FindBy and makes the WebDriver instance available to child classes.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • webDriver

      protected org.openqa.selenium.WebDriver webDriver
    • wait

      protected org.openqa.selenium.support.ui.WebDriverWait wait
  • Constructor Details

    • BasePageObject

      protected BasePageObject(org.openqa.selenium.WebDriver webDriver)
      Initiates page elements that are declared as fields annotated @FindBy and makes the WebDriver instance available to child classes.
      Parameters:
      webDriver - active WebDriver instance