Class WebBrowser

java.lang.Object
org.openqa.selenium.support.events.EventFiringWebDriver
org.alfresco.utility.web.browser.WebBrowser
All Implemented Interfaces:
org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver, org.openqa.selenium.WrapsDriver

public class WebBrowser extends org.openqa.selenium.support.events.EventFiringWebDriver
A wrapper around an arbitrary WebDriver instance which supports registering of a WebDriverEventListener for logging purposes.
Author:
Paul.Brodner
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

    org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
    protected TasProperties
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebBrowser(org.openqa.selenium.WebDriver driver, TasProperties properties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    authenticatedSession(org.apache.commons.httpclient.HttpState httpState)
    Inject auth cookie in current session so you don't need to login with LoginPage
    void
    This is working in combination with authenticatedSession(HttpState)
    void
    clickJS(org.openqa.selenium.WebElement elementToClick)
    Click WebElement with JavaScript command
    void
    Closes the window opened leaving the browser session opened
    void
    Closes the newly created win and swithes back to main
    void
    closeWindowAndSwitchBackParametrized(String windowToSwitchTo, String windowToClose)
    Closes the window and returns to selected window
    void
    deleteCookie(org.openqa.selenium.Cookie cookie)
    Delete cookie based on given cookie.
    void
    Function to delete the cookies in the browser
    void
    doubleClickOnElement(org.openqa.selenium.WebElement element)
    Double click on an element
    void
    dragAndDrop(org.openqa.selenium.WebElement source, int x, int y)
    Drag web element by x,y coordinates
    void
    dragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target)
    Drag the source element and drop into target element.
    void
    Execute Javascript command
    void
    executeJavaScript(String command, org.openqa.selenium.WebElement element)
    Execute Javascript command with WebElement
    List<org.openqa.selenium.WebElement>
    findDisplayedElementsFromLocator(org.openqa.selenium.By selector)
    This function will return list of visible elements found with the specified selector
    org.openqa.selenium.WebElement
    findFirstDisplayedElement(org.openqa.selenium.By locator)
    This function will return 1st visible element found with the specified selector
    org.openqa.selenium.WebElement
    findFirstElementWithExactValue(List<org.openqa.selenium.WebElement> list, String value)
    This function will return 1st element found with the exact specified value
    org.openqa.selenium.WebElement
    findFirstElementWithValue(List<org.openqa.selenium.WebElement> list, String value)
    This function will return 1st element found which contains a specified value
    org.openqa.selenium.WebElement
    findFirstElementWithValue(org.openqa.selenium.By locator, String value)
    This function will return 1st element found with a specified value
    void
    focusOnWebElement(org.openqa.selenium.WebElement webElement)
     
    org.openqa.selenium.Cookie
    Get a cookie that matches the name.
    Gets the URL of the previously visited page.
    getTextFromElementList(List<org.openqa.selenium.WebElement> elementsList)
     
    getTextFromLocatorList(org.openqa.selenium.By elementsList)
     
    void
     
    void
     
    boolean
     
    boolean
    isElementDisplayed(org.openqa.selenium.By locator)
    Returns true if the element is displayed else false.
    boolean
    isElementDisplayed(org.openqa.selenium.WebElement element)
    Returns true if the element is displayed else false.
    boolean
    isElementDisplayed(org.openqa.selenium.WebElement element, org.openqa.selenium.By locator)
    Returns true if the element is displayed else false.
    boolean
    isOptionSelectedForFilter(String option, org.openqa.selenium.WebElement filterElement)
     
    void
    Maximizes the current window if it is not already maximized
    void
    mouseOver(org.openqa.selenium.WebElement element)
    Recreating the action of hovering over a particular HTML element on a page.
    void
    mouseOver(org.openqa.selenium.WebElement element, int xOffset, int yOffset)
    Recreating the action of hovering over with offset coordinates a particular HTML element on a page.
    void
    mouseOverViaJavascript(org.openqa.selenium.WebElement webElement)
    Method to perform mouse over to a given web element, using JavaScript
    void
    Acts as a refresh page action similar to F5 key.
    void
    rightClickOnElement(org.openqa.selenium.WebElement element)
    Right click on an element
    void
    scrollIntoView(org.openqa.selenium.WebElement element)
    Scroll to WebElement
    void
    scrollToElement(org.openqa.selenium.WebElement element)
    Scroll to WebElement
    void
    selectOptionFromFilterOptionsList(String option, List<org.openqa.selenium.WebElement> filterOptionsList)
    This function selects specified filter option from filter options list
    void
    Method to switch back from i-frame to default content.
    void
    Method to switch on to frames of content object.
    void
    switchToWindow(String windowHandle)
    This method transfers the control to the specific window as per the given window handle.
    void
    Switches to the newly created window.
    void
    switchWindow(int windowIndex)
    Waits and switches to window based on index
    void
    switchWindow(String winHandler)
    Switches to window with specified url.
    void
    waitInSeconds(int seconds)
    Method to wait for given seconds.
    org.openqa.selenium.WebElement
    waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator)
    Wait for child WebElement as a part of parent element to present
    org.openqa.selenium.WebElement
    waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds)
    Wait for child WebElement as a part of parent element to present
    org.openqa.selenium.WebElement
    waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator)
    Wait for child WebElement as a part of parent element to present
    org.openqa.selenium.WebElement
    waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds)
    Wait for child WebElement as a part of parent element to present
    org.openqa.selenium.WebElement
    waitUntilElementClickable(org.openqa.selenium.By locator)
     
    org.openqa.selenium.WebElement
    waitUntilElementClickable(org.openqa.selenium.By locator, long timeOutInSeconds)
    Wait until the Clickable of given Element for given seconds.
    org.openqa.selenium.WebElement
    waitUntilElementClickable(org.openqa.selenium.WebElement element)
    Wait until the Clickable of given Element for given seconds.
    org.openqa.selenium.WebElement
    waitUntilElementClickable(org.openqa.selenium.WebElement element, long timeOutInSeconds)
    Wait until the Clickable of given Element for given seconds.
    void
    waitUntilElementContainsText(org.openqa.selenium.By locator, String text)
    Wait until the given text is present in the given Locator
    void
    waitUntilElementContainsText(org.openqa.selenium.WebElement element, String text)
    Wait until the given text is present in the given Element
    void
    waitUntilElementDeletedFromDom(org.openqa.selenium.By locator)
    Wait Until element successfully deleting from DOM.
    void
    waitUntilElementDeletedFromDom(org.openqa.selenium.By locator, long timeOutInSeconds)
    Wait Until element successfully deleting from DOM.
    void
    waitUntilElementDisappears(org.openqa.selenium.By locator)
    Wait until the invisibility of given Element for given seconds.
    void
    waitUntilElementDisappears(org.openqa.selenium.By locator, long timeOutInSeconds)
    Wait until the invisibility of given Element for given seconds.
    void
    waitUntilElementDisappears(org.openqa.selenium.WebElement locator)
    Wait until the invisibility of given Element for given seconds.
    void
    waitUntilElementDisappears(org.openqa.selenium.WebElement locator, long timeOutInSeconds)
    Wait until the invisibility of given Element for given seconds.
    void
    waitUntilElementDisappearsWithRetry(org.openqa.selenium.By locator, int secondsToWait)
    Wait the element to disappear by refreshing the page
    void
    waitUntilElementDoesNotContainText(org.openqa.selenium.WebElement element, String text)
    Wait until the given text is not present in the given Element
    void
    waitUntilElementHasAttribute(org.openqa.selenium.By locator, String attribute, String value)
     
    void
    waitUntilElementHasAttribute(org.openqa.selenium.WebElement element, String attribute, String value)
    Wait until the element has attribute for the specified amount of time.
    void
    waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator)
    Wait the element is displayed by refreshing the page
    void
    waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait)
    Wait the element is displayed by refreshing the page
    void
    waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait, int retryTimes)
    Wait the element is displayed by refreshing the page
    void
    waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait)
    Wait the element is displayed by refreshing the page
    org.openqa.selenium.WebElement
    waitUntilElementIsPresent(org.openqa.selenium.By locator)
    Wait until element is present on the DOM of a page.
    org.openqa.selenium.WebElement
    waitUntilElementIsPresent(org.openqa.selenium.By locator, long timeOutInSeconds)
    Wait until element is present on the DOM of a page.
    void
    waitUntilElementIsVisibleWithRetry(org.openqa.selenium.By locator, int retryCount)
    Wait until element is visible with retry
    List<org.openqa.selenium.WebElement>
    waitUntilElementsVisible(List<org.openqa.selenium.WebElement> elements)
    Helper method to find and return a slow loading collection of WebElement.
    List<org.openqa.selenium.WebElement>
    waitUntilElementsVisible(org.openqa.selenium.By locator)
    Helper method to find and return a slow loading collection of WebElement.
    org.openqa.selenium.WebElement
    waitUntilElementVisible(org.openqa.selenium.By locator)
    Wait until the element is visible for the specified amount of time.
    org.openqa.selenium.WebElement
    waitUntilElementVisible(org.openqa.selenium.By locator, long timeOutInSeconds)
    Wait until the element is visible for the specified amount of time.
    org.openqa.selenium.WebElement
    waitUntilElementVisible(org.openqa.selenium.WebElement element)
    Wait until the element is visible for the specified amount of time.
    org.openqa.selenium.WebElement
    waitUntilElementVisible(org.openqa.selenium.WebElement element, long timeOutInSeconds)
    Wait until the element is visible for the specified amount of time.
    void
    waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement)
    Wait until one element is displayed by refreshing the page
    void
    waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait)
    Wait until one element is displayed by refreshing the page
    void
    waitUrlContains(String URLfraction, long timeOutInSeconds)
    Wait until url contains the given URL fraction.
    org.openqa.selenium.WebElement
    waitWithRetryAndReturnWebElement(org.openqa.selenium.By locator, int secondsToWait, int retryTimes)
     

    Methods inherited from class org.openqa.selenium.support.events.EventFiringWebDriver

    close, executeAsyncScript, executeScript, findElement, findElements, get, getCapabilities, getCurrentUrl, getKeyboard, getMouse, getPageSource, getScreenshotAs, getTitle, getTouch, getWindowHandle, getWindowHandles, getWrappedDriver, manage, navigate, perform, quit, register, resetInputState, switchTo, unregister

    Methods inherited from class java.lang.Object

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

    • LOG

      protected static final org.slf4j.Logger LOG
    • properties

      protected TasProperties properties
  • Constructor Details

    • WebBrowser

      public WebBrowser(org.openqa.selenium.WebDriver driver, TasProperties properties)
  • Method Details

    • authenticatedSession

      public WebBrowser authenticatedSession(org.apache.commons.httpclient.HttpState httpState)
      Inject auth cookie in current session so you don't need to login with LoginPage
    • cleanUpAuthenticatedSession

      public void cleanUpAuthenticatedSession()
      This is working in combination with authenticatedSession(HttpState)
    • mouseOver

      public void mouseOver(org.openqa.selenium.WebElement element)
      Recreating the action of hovering over a particular HTML element on a page.
      Parameters:
      element - WebElement target
    • mouseOver

      public void mouseOver(org.openqa.selenium.WebElement element, int xOffset, int yOffset)
      Recreating the action of hovering over with offset coordinates a particular HTML element on a page.
      Parameters:
      element - WebElement target
    • mouseOverViaJavascript

      public void mouseOverViaJavascript(org.openqa.selenium.WebElement webElement)
      Method to perform mouse over to a given web element, using JavaScript
      Parameters:
      webElement - web element which will take the mouse over event
    • refresh

      public void refresh()
      Acts as a refresh page action similar to F5 key.
    • waitUntilElementHasAttribute

      public void waitUntilElementHasAttribute(org.openqa.selenium.WebElement element, String attribute, String value)
      Wait until the element has attribute for the specified amount of time.
      Parameters:
      element -
    • waitUntilElementHasAttribute

      public void waitUntilElementHasAttribute(org.openqa.selenium.By locator, String attribute, String value)
    • waitUntilElementVisible

      public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.By locator)
      Wait until the element is visible for the specified amount of time.
      Parameters:
      locator - By locator
    • waitUntilElementVisible

      public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.By locator, long timeOutInSeconds)
      Wait until the element is visible for the specified amount of time.
      Parameters:
      locator - By locator
      timeOutInSeconds - timeout in seconds
    • waitUntilElementIsPresent

      public org.openqa.selenium.WebElement waitUntilElementIsPresent(org.openqa.selenium.By locator, long timeOutInSeconds)
      Wait until element is present on the DOM of a page.
      Parameters:
      locator - By locator
      timeOutInSeconds - seconds to wait
      Returns:
      WebElement
    • waitUntilElementIsPresent

      public org.openqa.selenium.WebElement waitUntilElementIsPresent(org.openqa.selenium.By locator)
      Wait until element is present on the DOM of a page.
      Parameters:
      locator - By locator
      Returns:
      WebElement
    • waitUntilChildElementIsPresent

      public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds)
      Wait for child WebElement as a part of parent element to present
      Parameters:
      parentLocator - By parent locator
      childLocator - By child locator
      timeOutInSeconds - seconds to wait
      Returns:
      WebElement
    • waitUntilChildElementIsPresent

      public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.By parentLocator, org.openqa.selenium.By childLocator)
      Wait for child WebElement as a part of parent element to present
      Parameters:
      parentLocator - By parent locator
      childLocator - By child locator
      Returns:
      WebElement
    • waitUntilChildElementIsPresent

      public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator, long timeOutInSeconds)
      Wait for child WebElement as a part of parent element to present
      Parameters:
      parentLocator - WebElement parent locator
      childLocator - By child locator
      timeOutInSeconds - seconds to wait
      Returns:
      WebElement
    • waitUntilChildElementIsPresent

      public org.openqa.selenium.WebElement waitUntilChildElementIsPresent(org.openqa.selenium.WebElement parentLocator, org.openqa.selenium.By childLocator)
      Wait for child WebElement as a part of parent element to present
      Parameters:
      parentLocator - WebElement parent locator
      childLocator - By child locator
      Returns:
      WebElement
    • waitUntilElementVisible

      public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.WebElement element)
      Wait until the element is visible for the specified amount of time.
      Parameters:
      element - WebElement web element
    • waitUntilElementVisible

      public org.openqa.selenium.WebElement waitUntilElementVisible(org.openqa.selenium.WebElement element, long timeOutInSeconds)
      Wait until the element is visible for the specified amount of time.
      Parameters:
      element - WebElement web element
      timeOutInSeconds - timeout in seconds
    • waitUntilElementsVisible

      public List<org.openqa.selenium.WebElement> waitUntilElementsVisible(org.openqa.selenium.By locator)
      Helper method to find and return a slow loading collection of WebElement.
      Parameters:
      locator - By search criteria
      Returns:
      Collection of WebElement HTML elements
    • waitUntilElementsVisible

      public List<org.openqa.selenium.WebElement> waitUntilElementsVisible(List<org.openqa.selenium.WebElement> elements)
      Helper method to find and return a slow loading collection of WebElement.
      Parameters:
      elements - WebElement search criteria
      Returns:
      Collection of WebElement HTML elements
    • waitUntilElementIsDisplayedWithRetry

      public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator)
      Wait the element is displayed by refreshing the page
      Parameters:
      locator - By query
    • waitUntilElementIsDisplayedWithRetry

      public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait)
      Wait the element is displayed by refreshing the page
      Parameters:
      locator - By query
      secondsToWait -
    • waitUntilElementIsDisplayedWithRetry

      public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.By locator, int secondsToWait, int retryTimes)
      Wait the element is displayed by refreshing the page
      Parameters:
      locator - By query
      secondsToWait -
      retryTimes -
    • waitWithRetryAndReturnWebElement

      public org.openqa.selenium.WebElement waitWithRetryAndReturnWebElement(org.openqa.selenium.By locator, int secondsToWait, int retryTimes)
    • waitUntilElementIsDisplayedWithRetry

      public void waitUntilElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait)
      Wait the element is displayed by refreshing the page
      Parameters:
      webElement - WebElement query
      secondsToWait -
    • waitUntilElementDisappearsWithRetry

      public void waitUntilElementDisappearsWithRetry(org.openqa.selenium.By locator, int secondsToWait)
      Wait the element to disappear by refreshing the page
      Parameters:
      locator - By query
      secondsToWait -
    • waitUntilWebElementIsDisplayedWithRetry

      public void waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement)
      Wait until one element is displayed by refreshing the page
      Parameters:
      webElement -
    • waitUntilWebElementIsDisplayedWithRetry

      public void waitUntilWebElementIsDisplayedWithRetry(org.openqa.selenium.WebElement webElement, int secondsToWait)
      Wait until one element is displayed by refreshing the page
      Parameters:
      webElement -
      secondsToWait -
    • waitUntilElementClickable

      public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.WebElement element)
      Wait until the Clickable of given Element for given seconds.
      Parameters:
      element - WebElement
    • waitUntilElementClickable

      public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.By locator)
    • waitUntilElementClickable

      public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.By locator, long timeOutInSeconds)
      Wait until the Clickable of given Element for given seconds.
      Parameters:
      locator - CSS Locator
      timeOutInSeconds - Timeout In Seconds
    • waitUntilElementClickable

      public org.openqa.selenium.WebElement waitUntilElementClickable(org.openqa.selenium.WebElement element, long timeOutInSeconds)
      Wait until the Clickable of given Element for given seconds.
      Parameters:
      element - WebElement
      timeOutInSeconds - Timeout In Seconds
    • waitUntilElementContainsText

      public void waitUntilElementContainsText(org.openqa.selenium.WebElement element, String text)
      Wait until the given text is present in the given Element
      Parameters:
      element - WebElement
    • waitUntilElementContainsText

      public void waitUntilElementContainsText(org.openqa.selenium.By locator, String text)
      Wait until the given text is present in the given Locator
      Parameters:
      locator - Locator
    • waitUrlContains

      public void waitUrlContains(String URLfraction, long timeOutInSeconds)
      Wait until url contains the given URL fraction.
      Parameters:
      URLfraction -
      timeOutInSeconds -
    • waitUntilElementDeletedFromDom

      public void waitUntilElementDeletedFromDom(org.openqa.selenium.By locator)
      Wait Until element successfully deleting from DOM.
      Parameters:
      locator - By locator
    • waitUntilElementDeletedFromDom

      public void waitUntilElementDeletedFromDom(org.openqa.selenium.By locator, long timeOutInSeconds)
      Wait Until element successfully deleting from DOM.
      Parameters:
      locator - By locator
      timeOutInSeconds - time to wait
    • waitUntilElementDisappears

      public void waitUntilElementDisappears(org.openqa.selenium.By locator)
      Wait until the invisibility of given Element for given seconds.
      Parameters:
      locator - CSS Locator
    • waitUntilElementDisappears

      public void waitUntilElementDisappears(org.openqa.selenium.By locator, long timeOutInSeconds)
      Wait until the invisibility of given Element for given seconds.
      Parameters:
      locator - By Locator
      timeOutInSeconds - timeout In Seconds
    • waitUntilElementDisappears

      public void waitUntilElementDisappears(org.openqa.selenium.WebElement locator, long timeOutInSeconds)
      Wait until the invisibility of given Element for given seconds.
      Parameters:
      locator - By Locator
      timeOutInSeconds - timeout In Seconds
    • waitUntilElementDisappears

      public void waitUntilElementDisappears(org.openqa.selenium.WebElement locator)
      Wait until the invisibility of given Element for given seconds.
      Parameters:
      locator - CSS Locator
    • isElementDisplayed

      public boolean isElementDisplayed(org.openqa.selenium.By locator)
      Returns true if the element is displayed else false.
      Parameters:
      locator - By query
      Returns:
      boolean true if displayed
    • isElementDisplayed

      public boolean isElementDisplayed(org.openqa.selenium.WebElement element)
      Returns true if the element is displayed else false.
      Parameters:
      element - By query
      Returns:
      boolean true if displayed
    • isElementDisplayed

      public boolean isElementDisplayed(org.openqa.selenium.WebElement element, org.openqa.selenium.By locator)
      Returns true if the element is displayed else false.
      Parameters:
      locator - WebElement query By query
      Returns:
      boolean true if displayed
    • getPreviousUrl

      public String getPreviousUrl()
      Gets the URL of the previously visited page. The previous url is only displayed once interacted with the page. If user uses drone.navigetTo it will treat it as an entry page and will not have a previous page url.
      Returns:
      String previous page URL
    • switchToFrame

      public void switchToFrame(String frameId)
      Method to switch on to frames of content object.
      Parameters:
      frameId - String identifier
    • switchToDefaultContent

      public void switchToDefaultContent()
      Method to switch back from i-frame to default content.
    • switchWindow

      public void switchWindow()
      Switches to the newly created window.
    • switchWindow

      public void switchWindow(int windowIndex)
      Waits and switches to window based on index
    • switchWindow

      public void switchWindow(String winHandler)
      Switches to window with specified url.
    • closeWindowAndSwitchBack

      public void closeWindowAndSwitchBack()
      Closes the newly created win and swithes back to main
    • closeWindowAndSwitchBackParametrized

      public void closeWindowAndSwitchBackParametrized(String windowToSwitchTo, String windowToClose)
      Closes the window and returns to selected window
    • closeWindowAcceptingModalDialog

      public void closeWindowAcceptingModalDialog()
      Closes the window opened leaving the browser session opened
    • switchToWindow

      public void switchToWindow(String windowHandle)
      This method transfers the control to the specific window as per the given window handle.
      Parameters:
      windowHandle - identifier
    • getCookie

      public org.openqa.selenium.Cookie getCookie(String name)
      Get a cookie that matches the name.
      Parameters:
      name - String cookie identifier
      Returns:
      Cookie object
    • deleteCookies

      public void deleteCookies()
      Function to delete the cookies in the browser
    • deleteCookie

      public void deleteCookie(org.openqa.selenium.Cookie cookie)
      Delete cookie based on given cookie.
      Parameters:
      cookie - Cookie object to be deleted.
    • maximize

      public void maximize()
      Maximizes the current window if it is not already maximized
    • dragAndDrop

      public void dragAndDrop(org.openqa.selenium.WebElement source, org.openqa.selenium.WebElement target)
      Drag the source element and drop into target element.
      Parameters:
      source - Source WebElement
      target - Target WebElement
    • dragAndDrop

      public void dragAndDrop(org.openqa.selenium.WebElement source, int x, int y)
      Drag web element by x,y coordinates
      Parameters:
      source - html WebElement
      x - coordinate
      y - coordinate
    • doubleClickOnElement

      public void doubleClickOnElement(org.openqa.selenium.WebElement element)
      Double click on an element
      Parameters:
      element - WebElement
    • rightClickOnElement

      public void rightClickOnElement(org.openqa.selenium.WebElement element)
      Right click on an element
      Parameters:
      element - WebElement
    • findFirstDisplayedElement

      public org.openqa.selenium.WebElement findFirstDisplayedElement(org.openqa.selenium.By locator)
      This function will return 1st visible element found with the specified selector
      Parameters:
      locator - By selector type
      Returns:
      WebElement element to interact
    • findFirstElementWithValue

      public org.openqa.selenium.WebElement findFirstElementWithValue(org.openqa.selenium.By locator, String value)
      This function will return 1st element found with a specified value
      Parameters:
      locator - By identifier
      Returns:
      List of WebElement
    • findFirstElementWithValue

      public org.openqa.selenium.WebElement findFirstElementWithValue(List<org.openqa.selenium.WebElement> list, String value)
      This function will return 1st element found which contains a specified value
      Parameters:
      list - List<org.openqa.selenium.WebElement> identifier
      Returns:
      List of WebElement
    • findFirstElementWithExactValue

      public org.openqa.selenium.WebElement findFirstElementWithExactValue(List<org.openqa.selenium.WebElement> list, String value)
      This function will return 1st element found with the exact specified value
      Parameters:
      list -
      value -
      Returns:
    • findDisplayedElementsFromLocator

      public List<org.openqa.selenium.WebElement> findDisplayedElementsFromLocator(org.openqa.selenium.By selector)
      This function will return list of visible elements found with the specified selector
      Parameters:
      selector - By identifier
      Returns:
      List of WebElement
    • selectOptionFromFilterOptionsList

      public void selectOptionFromFilterOptionsList(String option, List<org.openqa.selenium.WebElement> filterOptionsList)
      This function selects specified filter option from filter options list
      Parameters:
      option - Option to be selected
      filterOptionsList - The filter Option List
    • isOptionSelectedForFilter

      public boolean isOptionSelectedForFilter(String option, org.openqa.selenium.WebElement filterElement)
    • scrollToElement

      public void scrollToElement(org.openqa.selenium.WebElement element)
      Scroll to WebElement
      Parameters:
      element - WebElement
    • scrollIntoView

      public void scrollIntoView(org.openqa.selenium.WebElement element)
      Scroll to WebElement
      Parameters:
      element - WebElement
    • waitInSeconds

      public void waitInSeconds(int seconds)
      Method to wait for given seconds.
      Parameters:
      seconds - time in seconds
    • executeJavaScript

      public void executeJavaScript(String command)
      Execute Javascript command
      Parameters:
      command -
    • executeJavaScript

      public void executeJavaScript(String command, org.openqa.selenium.WebElement element)
      Execute Javascript command with WebElement
      Parameters:
      command -
      element - WebElement
    • clickJS

      public void clickJS(org.openqa.selenium.WebElement elementToClick)
      Click WebElement with JavaScript command
      Parameters:
      elementToClick -
    • isAlertPresent

      public boolean isAlertPresent()
    • handleModalDialogAcceptingAlert

      public void handleModalDialogAcceptingAlert()
    • handleModalDialogDismissingAlert

      public void handleModalDialogDismissingAlert()
    • focusOnWebElement

      public void focusOnWebElement(org.openqa.selenium.WebElement webElement)
    • waitUntilElementIsVisibleWithRetry

      public void waitUntilElementIsVisibleWithRetry(org.openqa.selenium.By locator, int retryCount)
      Wait until element is visible with retry
      Parameters:
      locator -
      retryCount -
    • waitUntilElementDoesNotContainText

      public void waitUntilElementDoesNotContainText(org.openqa.selenium.WebElement element, String text)
      Wait until the given text is not present in the given Element
      Parameters:
      element - WebElement
    • getTextFromLocatorList

      public List<String> getTextFromLocatorList(org.openqa.selenium.By elementsList)
    • getTextFromElementList

      public List<String> getTextFromElementList(List<org.openqa.selenium.WebElement> elementsList)