Class WebBrowser

  • All Implemented Interfaces:
    org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.internal.WrapsDriver, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver

    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 org.slf4j.Logger LOG  
      protected TasProperties properties  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WebBrowser authenticatedSession​(org.apache.commons.httpclient.HttpState httpState)
      Inject auth cookie in current session so you don't need to login with LoginPage
      void cleanUpAuthenticatedSession()
      This is working in combination with #authenticateSession(String, String)
      void clickJS​(org.openqa.selenium.WebElement elementToClick)
      Click WebElement with JavaScript command
      void closeWindowAcceptingModalDialog()
      Closes the window opened leaving the browser session opened
      void closeWindowAndSwitchBack()
      Closes the newly created win and swithes back to main
      void closeWindowAndSwitchBackParametrized​(java.lang.String windowToSwitchTo, java.lang.String windowToClose)
      Closes the window and returns to selected window
      void deleteCookie​(org.openqa.selenium.Cookie cookie)
      Delete cookie based on given cookie.
      void deleteCookies()
      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 executeJavaScript​(java.lang.String command)
      Execute Javascript command
      void executeJavaScript​(java.lang.String command, org.openqa.selenium.WebElement element)
      Execute Javascript command with WebElement
      java.util.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​(java.util.List<org.openqa.selenium.WebElement> list, java.lang.String value)
      This function will return 1st element found with the exact specified value
      org.openqa.selenium.WebElement findFirstElementWithValue​(java.util.List<org.openqa.selenium.WebElement> list, java.lang.String value)
      This function will return 1st element found which contains a specified value
      org.openqa.selenium.WebElement findFirstElementWithValue​(org.openqa.selenium.By locator, java.lang.String value)
      This function will return 1st element found with a specified value
      void focusOnWebElement​(org.openqa.selenium.WebElement webElement)  
      org.openqa.selenium.Cookie getCookie​(java.lang.String name)
      Get a cookie that matches the name.
      java.lang.String getPreviousUrl()
      Gets the URL of the previously visited page.
      void handleModalDialogAcceptingAlert()  
      void handleModalDialogDismissingAlert()  
      boolean isAlertPresent()  
      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​(java.lang.String option, org.openqa.selenium.WebElement filterElement)  
      void maximize()
      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 refresh()
      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​(java.lang.String option, java.util.List<org.openqa.selenium.WebElement> filterOptionsList)
      This function selects specified filter option from filter options list
      void switchToDefaultContent()
      Method to switch back from i-frame to default content.
      void switchToFrame​(java.lang.String frameId)
      Method to switch on to frames of content object.
      void switchToWindow​(java.lang.String windowHandle)
      This method transfers the control to the specific window as per the given window handle.
      void switchWindow()
      Switches to the newly created window.
      void switchWindow​(int windowIndex)
      Waits and switches to window based on index
      void switchWindow​(java.lang.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, 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.WebElement element, java.lang.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 waitUntilElementDisappearsWithRetry​(org.openqa.selenium.By locator, int secondsToWait)
      Wait the element to disappear by refreshing the page
      void waitUntilElementDoesNotContainText​(org.openqa.selenium.WebElement element, java.lang.String text)
      Wait until the given text is not present in the given Element
      void waitUntilElementHasAttribute​(org.openqa.selenium.WebElement element, java.lang.String attribute, java.lang.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
      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
      java.util.List<org.openqa.selenium.WebElement> waitUntilElementsVisible​(java.util.List<org.openqa.selenium.WebElement> elements)
      Helper method to find and return a slow loading collection of WebElement.
      java.util.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​(java.lang.String URLfraction, long timeOutInSeconds)
      Wait until url contains the given URL fraction.
      • Methods inherited from class org.openqa.selenium.support.events.EventFiringWebDriver

        close, executeAsyncScript, executeScript, findElement, findElements, get, 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 Detail

      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • WebBrowser

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

      • 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 #authenticateSession(String, String)
      • 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
      • refresh

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

        public void waitUntilElementHasAttribute​(org.openqa.selenium.WebElement element,
                                                 java.lang.String attribute,
                                                 java.lang.String value)
        Wait until the element has attribute for the specified amount of time.
        Parameters:
        element -
      • 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 java.util.List<org.openqa.selenium.WebElement> waitUntilElementsVisible​(org.openqa.selenium.By locator)
        Helper method to find and return a slow loading collection of WebElement.
        Parameters:
        criteria - By search criteria
        Returns:
        Collection of WebElement HTML elements
      • waitUntilElementsVisible

        public java.util.List<org.openqa.selenium.WebElement> waitUntilElementsVisible​(java.util.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 -
      • 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,
                                                                        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,
                                                 java.lang.String text)
        Wait until the given text is present in the given Element
        Parameters:
        element - WebElement
      • waitUrlContains

        public void waitUrlContains​(java.lang.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
      • 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 java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String windowToSwitchTo,
                                                         java.lang.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​(java.lang.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​(java.lang.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,
                                                                        java.lang.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​(java.util.List<org.openqa.selenium.WebElement> list,
                                                                        java.lang.String value)
        This function will return 1st element found which contains a specified value
        Parameters:
        list - List identifier
        Returns:
        List of WebElement
      • findFirstElementWithExactValue

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

        public java.util.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​(java.lang.String option,
                                                      java.util.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​(java.lang.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​(java.lang.String command)
        Execute Javascript command
        Parameters:
        command -
      • executeJavaScript

        public void executeJavaScript​(java.lang.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,
                                                       java.lang.String text)
        Wait until the given text is not present in the given Element
        Parameters:
        element - WebElement