Package com.qcefast.frameworkSpecific
Class FastDriver
- java.lang.Object
-
- com.qcefast.frameworkSpecific.FastDriver
-
public class FastDriver extends java.lang.Object
This class is used by the FAST Framework to findFastElement
- 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 constructorFastDriver(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 windowvoid
alertDismiss()
Dismisses a basic html alert that popped up on the current driver windowvoid
closeAllBrowsers(Framework framework)
Closes all open windows using the specified frameworkjava.lang.String
closeBrowerTab(java.lang.String pageTitle, Framework framework)
Closes the browser tab with the specified pageTitle using the specified frameworkvoid
closeDriver()
Close this FastDriverFastElement
findFastElement(FastElement fastElement)
Finds a the specified fastElementFastElement
findFastElement(FastElementProperties fastElementProperties, Framework framework)
Finds an element using the passed in fastElementProperties and the specified framework, and then returns it represented as aFastElement
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 itjava.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 ofFastElement
java.lang.String
getDriverMainWindow()
Returns the initial window for this FastDriver.org.openqa.selenium.WebDriver
getWebDriver()
Returns the selenium webdriver that this FastDriver is usingvoid
refreshPage()
Refreshes the current window that the FastDriver is on.void
setDriverMainWindow(java.lang.String driverMainWindow)
Sets the initial window for this FastDrivervoid
setWebDriver(org.openqa.selenium.WebDriver webDriver)
Sets the selenium webDriver this FastDriver will usestatic void
sleep(double seconds)
Pause the run for the specified amount of secondsjava.lang.String
switchTab(java.lang.String newTab, Framework framework)
Switches the tab specified by newTab using the specified framework
-
-
-
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 aFastNavigatorException
.- 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 closedframework
- 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 toframework
- 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 aFastElement
- Parameters:
fastElementProperties
- Properties being used to find the elementframework
- 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 ofFastElement
- Parameters:
fastElementProperties
- Properties being used to find the elementsframework
- 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 elementchild
- 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
-
-