Class 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 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.
    • Field Detail

      • webDriver

        protected org.openqa.selenium.WebDriver webDriver
      • wait

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

      • 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