Package com.qcefast.frameworkSpecific
Class BrowserUtilHelper
- java.lang.Object
-
- com.qcefast.frameworkSpecific.BrowserUtilHelper
-
public class BrowserUtilHelper extends java.lang.Object
A helper class for Browser Util created for use with selenium- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description BrowserUtilHelper()
-
Method Summary
Modifier and Type Method Description static java.lang.String
closeAllBrowsers(FastRunProperties fastRunProperties, Framework framework)
Closes all open browsersstatic java.lang.String
closeBrowserTab(java.lang.String pageTitle, FastRunProperties fastRunProperties, Framework framework)
Closes the specified browser tabstatic void
maximizeBrowser(FastDriver fastDriver, Framework framework)
Maximizes the browser using the designated frameworkstatic void
navigate(java.lang.String url, FastRunProperties fastRunProperties, Framework framework)
Navigates to the specified url using the designated frameworkstatic void
setBackToDefault(FastRunProperties fastRunProperties)
Sets driver back to default browserstatic java.lang.String
switchFrame(FastElement fastElement, Framework framework)
Switches to the frame found using the passed in valuesstatic java.lang.String
switchTab(java.lang.String newTab, FastRunProperties fastRunProperties, Framework framework)
Switches to the specified tabstatic void
takeScreenshot(java.lang.String sshotPth, FastRunProperties fastRunProperties, Framework framework)
Takes a screenshot and saves the image to the specified path
-
-
-
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 tofastRunProperties
- The properties Fast is running withframework
- 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 maximizedframework
- 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 withframework
- 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 closedfastRunProperties
- The properties Fast is running withframework
- 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 withframework
- 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 tofastRunProperties
- Properties FAST in running withframework
- 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 toframework
- 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
-
-