Class BasePage

java.lang.Object
co.verisoft.fw.pages.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.openqa.selenium.WebDriver
     
    protected final int
     
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasePage(org.openqa.selenium.WebDriver driver)
    C-tor.
    BasePage(org.openqa.selenium.WebDriver driver, String objectRepositoryFilePath)
    C-tor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    Checks if driver is on page
    boolean
    isOnPage(org.openqa.selenium.By locator)
    This is a another implementation of isOnPage.
    boolean
    isOnPage(org.openqa.selenium.WebElement... elements)
    This is a default implementation of isOnPage.
    boolean
    urlContains(String fraction)
    check if the main page url contains the text

    Methods inherited from class java.lang.Object

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

    • driver

      protected org.openqa.selenium.WebDriver driver
    • timeOut

      protected final int timeOut
    • pollingInterval

      protected final int pollingInterval
    • repository

      protected ObjectRepository repository
  • Constructor Details

    • 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
    • BasePage

      public BasePage(org.openqa.selenium.WebDriver driver, String objectRepositoryFilePath)
      C-tor. Initializes generic properties such as timeOut and pollingInterval
      Parameters:
      driver - a WebDriver object to store and use
      objectRepositoryFilePath - a custom path to the object repository file
  • Method Details

    • 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