Class BasePage

  • Direct Known Subclasses:
    MobileBasePage, WebBasePage

    public abstract class BasePage
    extends Object
    Represent base page for WebDriver interface (Web, mobile, client - server) This class contains the basic common functionality shared by all pages
    Author:
    David Yehezkel 30 Mar 2020
    • Field Detail

      • driver

        protected org.openqa.selenium.WebDriver driver
      • timeOut

        protected final int timeOut
      • pollingInterval

        protected final int pollingInterval
    • Constructor Detail

      • BasePage

        public BasePage​(org.openqa.selenium.WebDriver driver)
        C-tor. Initializes generic properties such as timeOut and pollingInterval
        Parameters:
        driver - a WebDriver object to store and use
    • Method Detail

      • isOnPage

        public boolean isOnPage​(org.openqa.selenium.WebElement... elements)
        This is a default implementation of isOnPage. It receives one or more WebElements and checks if they are present
        Parameters:
        elements - One or more WebElements to check for presence
        Returns:
        true- all elements specified were present, false - otherwise
      • isOnPage

        public boolean isOnPage​(org.openqa.selenium.By locator)
        This is a another implementation of isOnPage. It receives a locator and checks if all the WebElements located by this locator are present
        Parameters:
        locator - By parameter to check for presence
        Returns:
        true- all elements specified were present, false - otherwise
      • urlContains

        public boolean urlContains​(String fraction)
        check if the main page url contains the text
        Parameters:
        fraction - part of url to be search for
        Returns:
        true if text contains false otherwise
      • isOnPage

        public abstract boolean isOnPage()
        Checks if driver is on page
        Returns:
        true- all elements specified were present, false - otherwise