Class WebUtilsSelenium


  • public final class WebUtilsSelenium
    extends java.lang.Object
    Utility class for web methods
    Author:
    Frank Münster
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] getSeleniumPdfAsByteArray​(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement)
      Read the account statement PDF into a byte array.
      static byte[] getSeleniumPdfAsByteArray​(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement, java.lang.String expectedFileName)
      Read the account statement PDF into a byte array.
      static void scrollTo​(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
      Scroll to an element so it is visible at the top on top
      static void scrollTo​(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, boolean scrollTo)
      Scroll to an element so it is visible at scrollTo position
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSeleniumPdfAsByteArray

        public static byte[] getSeleniumPdfAsByteArray​(org.openqa.selenium.WebDriver driver,
                                                       org.openqa.selenium.WebElement linkElement)
                                                throws WebSiteException
        Read the account statement PDF into a byte array.
        Parameters:
        driver - the WebDriver to use
        linkElement - the link on the page to the PDF
        expectedFileName -
        Returns:
        the PDF as byte array
        Throws:
        WebSiteException
      • getSeleniumPdfAsByteArray

        public static byte[] getSeleniumPdfAsByteArray​(org.openqa.selenium.WebDriver driver,
                                                       org.openqa.selenium.WebElement linkElement,
                                                       java.lang.String expectedFileName)
        Read the account statement PDF into a byte array.
        Parameters:
        driver - the WebDriver to use
        linkElement - the link on the page to the PDF
        expectedFileName -
        Returns:
        the PDF as byte array
      • scrollTo

        public static void scrollTo​(org.openqa.selenium.WebDriver driver,
                                    org.openqa.selenium.WebElement element)
        Scroll to an element so it is visible at the top on top
      • scrollTo

        public static void scrollTo​(org.openqa.selenium.WebDriver driver,
                                    org.openqa.selenium.WebElement element,
                                    boolean scrollTo)
        Scroll to an element so it is visible at scrollTo position
        Parameters:
        scrollTo - true top of element on top of view area, false bottom of element on bottom of view area