Class FastDriver


  • public class FastDriver
    extends java.lang.Object
    This class is used by the FAST Framework to find FastElement
    Since:
    1.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FastDriver.TagNames
      This enum is used to designate tagnames
    • Constructor Summary

      Constructors 
      Constructor Description
      FastDriver()
      Default constructor
      FastDriver​(org.openqa.selenium.WebDriver webDriver)
      Sets the driver that this FastDriver is going to use
    • Method Summary

      Modifier and Type Method Description
      void alertAccept()
      Accepts a basic html alert that popped up on the current driver window
      void alertDismiss()
      Dismisses a basic html alert that popped up on the current driver window
      void closeAllBrowsers​(Framework framework)
      Closes all open windows using the specified framework
      java.lang.String closeBrowerTab​(java.lang.String pageTitle, Framework framework)
      Closes the browser tab with the specified pageTitle using the specified framework
      void closeDriver()
      Close this FastDriver
      FastElement findFastElement​(FastElement fastElement)
      Finds a the specified fastElement
      FastElement findFastElement​(FastElementProperties fastElementProperties, Framework framework)
      Finds an element using the passed in fastElementProperties and the specified framework, and then returns it represented as a FastElement
      FastElement findFastElement​(FastElement parent, FastElement child)
      Finds the specified child element by finding the specified parent element first, then finding the specified child element within it
      java.util.List<FastElement> findFastElements​(FastElementProperties fastElementProperties, Framework framework)
      Finds multiple elements using the passed in fastElementProperties and the specified framework, and then returns them represented as a list of FastElement
      java.lang.String getDriverMainWindow()
      Returns the initial window for this FastDriver.
      org.openqa.selenium.WebDriver getWebDriver()
      Returns the selenium webdriver that this FastDriver is using
      void refreshPage()
      Refreshes the current window that the FastDriver is on.
      void setDriverMainWindow​(java.lang.String driverMainWindow)
      Sets the initial window for this FastDriver
      void setWebDriver​(org.openqa.selenium.WebDriver webDriver)
      Sets the selenium webDriver this FastDriver will use
      static void sleep​(double seconds)
      Pause the run for the specified amount of seconds
      java.lang.String switchTab​(java.lang.String newTab, Framework framework)
      Switches the tab specified by newTab using the specified framework
      • Methods inherited from class java.lang.Object

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

      • FastDriver

        public FastDriver()
        Default constructor
        Since:
        1.0.0
      • FastDriver

        public FastDriver​(org.openqa.selenium.WebDriver webDriver)
        Sets the driver that this FastDriver is going to use
        Parameters:
        webDriver - A selenium webdriver
        Since:
        1.0.0
    • Method Detail

      • getWebDriver

        public org.openqa.selenium.WebDriver getWebDriver()
        Returns the selenium webdriver that this FastDriver is using
        Returns:
        The webDriver
        Since:
        1.0.0
      • setWebDriver

        public void setWebDriver​(org.openqa.selenium.WebDriver webDriver)
        Sets the selenium webDriver this FastDriver will use
        Parameters:
        webDriver - A selenium webDriver
        Since:
        1.0.0
      • getDriverMainWindow

        public java.lang.String getDriverMainWindow()
        Returns the initial window for this FastDriver. If the initial window has been closed, the second window will have been set as the initial window, and will be returned instead. If the second window has been closed, the third will be returns, and so on.
        Returns:
        The initial window
        Since:
        1.0.0
      • setDriverMainWindow

        public void setDriverMainWindow​(java.lang.String driverMainWindow)
        Sets the initial window for this FastDriver
        Parameters:
        driverMainWindow - The initial window
        Since:
        1.0.0
      • refreshPage

        public void refreshPage()
                         throws FastException
        Refreshes the current window that the FastDriver is on. If no webDriver has been set, this method will throw a FastNavigatorException.
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • alertAccept

        public void alertAccept()
                         throws FastException
        Accepts a basic html alert that popped up on the current driver window
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • alertDismiss

        public void alertDismiss()
                          throws FastException
        Dismisses a basic html alert that popped up on the current driver window
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • findFastElement

        public FastElement findFastElement​(FastElement fastElement)
                                    throws FastException
        Finds a the specified fastElement
        Parameters:
        fastElement - The fastElement that this FastDriver will attempt to find
        Returns:
        The fastElement after it has been found
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeBrowerTab

        public java.lang.String closeBrowerTab​(java.lang.String pageTitle,
                                               Framework framework)
                                        throws FastException
        Closes the browser tab with the specified pageTitle using the specified framework
        Parameters:
        pageTitle - The title of the tab that will be closed
        framework - The framework that will be used to close the tab
        Returns:
        Empty string if tab successfully found and closed. Error message, if the tab was not found
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeAllBrowsers

        public void closeAllBrowsers​(Framework framework)
        Closes all open windows using the specified framework
        Parameters:
        framework - Framework being used to closed browser windows
        Since:
        1.0.0
      • switchTab

        public java.lang.String switchTab​(java.lang.String newTab,
                                          Framework framework)
                                   throws FastException
        Switches the tab specified by newTab using the specified framework
        Parameters:
        newTab - The title of the tab that the driver will switch to
        framework - The framework being used to switch tabs
        Returns:
        Empty string if tab successfully found and closed. Error message, if the tab was not found
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • findFastElement

        public FastElement findFastElement​(FastElementProperties fastElementProperties,
                                           Framework framework)
                                    throws FastException
        Finds an element using the passed in fastElementProperties and the specified framework, and then returns it represented as a FastElement
        Parameters:
        fastElementProperties - Properties being used to find the element
        framework - Framework that will be used to find the element
        Returns:
        The found FastElement
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • findFastElements

        public java.util.List<FastElement> findFastElements​(FastElementProperties fastElementProperties,
                                                            Framework framework)
                                                     throws FastException
        Finds multiple elements using the passed in fastElementProperties and the specified framework, and then returns them represented as a list of FastElement
        Parameters:
        fastElementProperties - Properties being used to find the elements
        framework - Framework that will be used to find the elements
        Returns:
        The found FastElements
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • findFastElement

        public FastElement findFastElement​(FastElement parent,
                                           FastElement child)
                                    throws FastException
        Finds the specified child element by finding the specified parent element first, then finding the specified child element within it
        Parameters:
        parent - The parent element
        child - The child element
        Returns:
        The found child element
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • sleep

        public static void sleep​(double seconds)
                          throws FastException
        Pause the run for the specified amount of seconds
        Parameters:
        seconds - The number of seconds
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeDriver

        public void closeDriver()
        Close this FastDriver
        Since:
        1.0.0