Package FlaNium.WinAPI.webdriver
Class FlaNiumDriver
- java.lang.Object
-
- org.openqa.selenium.remote.RemoteWebDriver
-
- FlaNium.WinAPI.webdriver.FlaNiumDriver
-
- All Implemented Interfaces:
org.openqa.selenium.HasCapabilities,org.openqa.selenium.interactions.Interactive,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.PrintsPage,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator,org.openqa.selenium.WebDriver
public class FlaNiumDriver extends org.openqa.selenium.remote.RemoteWebDriver
-
-
Constructor Summary
Constructors Constructor Description FlaNiumDriver(FlaNiumDriverService service, FlaNiumOptions options)Initializes a new instance of theFlaNiumDriverclass using the specifiedFlaNiumDriverServiceand options.FlaNiumDriver(FlaNiumDriverService service, org.openqa.selenium.remote.DesiredCapabilities dc)Initializes a new instance of theFlaNiumDriverclass using the specifiedFlaNiumDriverServiceand options.FlaNiumDriver(URL remoteAddress, FlaNiumOptions options)Initializes a new instance of theFlaNiumDriverlass using the specified remote address and options.FlaNiumDriver(URL remoteAddress, org.openqa.selenium.remote.DesiredCapabilities dc)Initializes a new instance of theFlaNiumDriverlass using the specified remote address and options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeProcess(String processName, int timeOut)Attaches to the first process found by name.voiddeleteFileOrDirectory(String path)Deletes a file or folder at the specified path.org.openqa.selenium.remote.Responseexecute(String command)org.openqa.selenium.remote.Responseexecute(String driverCommand, Map<String,?> parameters)booleanfileOrDirectoryExists(String path)Checks if a file or folder exists at the specified path.org.openqa.selenium.remote.RemoteWebElementgetActiveWindow()Get the active window or current root element.KeyboardActionskeyboardActions()Get Keyboard Actions instance.voidkillAllProcessesByName(String processName)Terminates all processes found by name.MouseActionsmouseActions()Get Mouse Actions instance.voidresetRootElement()Sets the main window of the connected process as the root element.ScreenshotActionsscreenshotActions()Get Screenshot Actions of current item.voidsetDesktopAsRootElement()Sets the desktop as the root element for item searches and other actions.voidsetRootElement(org.openqa.selenium.remote.RemoteWebElement webElement)Sets the given web element as the root element.voidstartApp(String appPath, String appArguments, Integer launchDelayMs)Launches the application at the given path.TouchActionstouchActions()Get Touch Actions instance.-
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, builder, close, execute, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, findElements, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, print, quit, removeVirtualAuthenticator, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString
-
-
-
-
Constructor Detail
-
FlaNiumDriver
public FlaNiumDriver(FlaNiumDriverService service, FlaNiumOptions options)
Initializes a new instance of theFlaNiumDriverclass using the specifiedFlaNiumDriverServiceand options.- Parameters:
service- TheFlaNiumDriverServiceto use.options- TheFlaNiumOptionsused to initialize the driver.
-
FlaNiumDriver
public FlaNiumDriver(FlaNiumDriverService service, org.openqa.selenium.remote.DesiredCapabilities dc)
Initializes a new instance of theFlaNiumDriverclass using the specifiedFlaNiumDriverServiceand options.- Parameters:
service- TheFlaNiumDriverServiceto use.dc- TheDesiredCapabilitiesused to initialize the driver.
-
FlaNiumDriver
public FlaNiumDriver(URL remoteAddress, FlaNiumOptions options)
Initializes a new instance of theFlaNiumDriverlass using the specified remote address and options.- Parameters:
remoteAddress- URL containing the address of the FlaNiumDriver remote server.options- TheFlaNiumOptionsobject to be used with the FlaNium driver.
-
FlaNiumDriver
public FlaNiumDriver(URL remoteAddress, org.openqa.selenium.remote.DesiredCapabilities dc)
Initializes a new instance of theFlaNiumDriverlass using the specified remote address and options.- Parameters:
remoteAddress- URL containing the address of the FlaNiumDriver remote server.dc- TheDesiredCapabilitiesobject to be used with the FlaNium driver.
-
-
Method Detail
-
execute
public org.openqa.selenium.remote.Response execute(String driverCommand, Map<String,?> parameters)
- Overrides:
executein classorg.openqa.selenium.remote.RemoteWebDriver
-
execute
public org.openqa.selenium.remote.Response execute(String command)
- Overrides:
executein classorg.openqa.selenium.remote.RemoteWebDriver
-
getActiveWindow
public org.openqa.selenium.remote.RemoteWebElement getActiveWindow()
Get the active window or current root element.- Returns:
- The active window or current root element.
-
setDesktopAsRootElement
public void setDesktopAsRootElement()
Sets the desktop as the root element for item searches and other actions. By default, the root element is the application's main window.
-
resetRootElement
public void resetRootElement()
Sets the main window of the connected process as the root element.
-
setRootElement
public void setRootElement(org.openqa.selenium.remote.RemoteWebElement webElement)
Sets the given web element as the root element.- Parameters:
webElement- Any web element.
-
changeProcess
public void changeProcess(String processName, int timeOut)
Attaches to the first process found by name. Changes the root element to the process's main window. Also terminates the given process at the end of the session.- Parameters:
processName- Process name.timeOut- process search timeout in ms.
-
killAllProcessesByName
public void killAllProcessesByName(String processName)
Terminates all processes found by name.- Parameters:
processName- Process name.
-
fileOrDirectoryExists
public boolean fileOrDirectoryExists(String path)
Checks if a file or folder exists at the specified path.- Parameters:
path- Path to folder or file. System variables are supported, for example:
"<LOCALAPPDATA>/folder/file.exe"
-
deleteFileOrDirectory
public void deleteFileOrDirectory(String path)
Deletes a file or folder at the specified path.
If an error occurs during deletion or the file or folder is missing, an exception is thrown.- Parameters:
path- Path to folder or file. System variables are supported, for example:
"<LOCALAPPDATA>/folder/file.exe"
-
startApp
public void startApp(String appPath, String appArguments, Integer launchDelayMs)
Launches the application at the given path.- Parameters:
appPath- The absolute path to an .exe file to be started. System variables are supported, for example:
"<LOCALAPPDATA>/folder/file.exe"appArguments- Startup arguments of the application. May be null.launchDelayMs- Static timeout to start in ms.
-
touchActions
public TouchActions touchActions()
Get Touch Actions instance.- Returns:
- Touch Actions instance.
-
keyboardActions
public KeyboardActions keyboardActions()
Get Keyboard Actions instance.- Returns:
- Keyboard Actions instance.
-
mouseActions
public MouseActions mouseActions()
Get Mouse Actions instance.- Returns:
- Mouse Actions instance.
-
screenshotActions
public ScreenshotActions screenshotActions()
Get Screenshot Actions of current item.- Returns:
- ScreenshotActions instance.
-
-