Class BasePageObject

java.lang.Object
uk.co.evoco.pageobjects.BasePageObject

public abstract class BasePageObject
extends java.lang.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 wait  
    protected org.openqa.selenium.WebDriver webDriver  
  • Constructor Summary

    Constructors 
    Constructor Description
    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

      public 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