Class BrowserUtilHelper


  • public class BrowserUtilHelper
    extends java.lang.Object
    A helper class for Browser Util created for use with selenium
    Since:
    1.0.0
    • Constructor Detail

      • BrowserUtilHelper

        public BrowserUtilHelper()
    • Method Detail

      • navigate

        public static void navigate​(java.lang.String url,
                                    FastRunProperties fastRunProperties,
                                    Framework framework)
                             throws FastException
        Navigates to the specified url using the designated framework
        Parameters:
        url - The url to navigate to
        fastRunProperties - The properties Fast is running with
        framework - The framework to use
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • maximizeBrowser

        public static void maximizeBrowser​(FastDriver fastDriver,
                                           Framework framework)
                                    throws FastException
        Maximizes the browser using the designated framework
        Parameters:
        fastDriver - The driver that will be maximized
        framework - The Framework being used to maximize the browser
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeAllBrowsers

        public static java.lang.String closeAllBrowsers​(FastRunProperties fastRunProperties,
                                                        Framework framework)
                                                 throws FastException
        Closes all open browsers
        Parameters:
        fastRunProperties - The properties Fast is running with
        framework - The Framework being used to close the browsers
        Returns:
        A status message
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • closeBrowserTab

        public static java.lang.String closeBrowserTab​(java.lang.String pageTitle,
                                                       FastRunProperties fastRunProperties,
                                                       Framework framework)
                                                throws FastException
        Closes the specified browser tab
        Parameters:
        pageTitle - The title of tab that is to be closed
        fastRunProperties - The properties Fast is running with
        framework - The Framework being used to close the browser tab
        Returns:
        Empty string if successful, error message if not.
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • takeScreenshot

        public static void takeScreenshot​(java.lang.String sshotPth,
                                          FastRunProperties fastRunProperties,
                                          Framework framework)
                                   throws FastException
        Takes a screenshot and saves the image to the specified path
        Parameters:
        sshotPth - The location and file name the screenshot is saved to.
        fastRunProperties - The properties that Fast is running with
        framework - The Framework being used to take this screenshot
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • switchTab

        public static java.lang.String switchTab​(java.lang.String newTab,
                                                 FastRunProperties fastRunProperties,
                                                 Framework framework)
                                          throws FastException
        Switches to the specified tab
        Parameters:
        newTab - The tab being switched to
        fastRunProperties - Properties FAST in running with
        framework - The Framework being used to switch tabs
        Returns:
        The status of the step
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • switchFrame

        public static java.lang.String switchFrame​(FastElement fastElement,
                                                   Framework framework)
                                            throws FastException
        Switches to the frame found using the passed in values
        Parameters:
        fastElement - The frame to switch to
        framework - The framework being used to switch frames
        Returns:
        The status of the step
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • setBackToDefault

        public static void setBackToDefault​(FastRunProperties fastRunProperties)
                                     throws FastException
        Sets driver back to default browser
        Parameters:
        fastRunProperties - The properties Fast is running with
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0