public class RPA
extends java.lang.Object
The following classes are also automatically imported into Machine configs.
They are accessible by their short-class-name (e.g. RemoteWebDriver)
org.openqa.selenium.remote.RemoteWebDriverorg.openqa.selenium.interactions.Actionorg.openqa.selenium.interactions.Mouseorg.openqa.selenium.interactions.Keyboardorg.openqa.selenium.support.ui.Waitorg.openqa.selenium.support.ui.FluentWaitorg.openqa.selenium.support.ui.WebDriverWaitorg.openqa.selenium.support.ui.ExpectedConditionorg.openqa.selenium.support.ui.ExpectedConditionscom.workfusion.rpa.interactions.ActionsApiUtilsPointedCoordinatesRobotsMouseUiElementUiElementCollectionUiConditionUiCollectionConditionClasses from the following packages also are automatically imported into Machine configs:
Main simplified methods:
driver() - accessing current driver instance. keyboard() - current driver keyboard.mouse() - current driver mouse.$(By) - finds the first element matching given descriptor.$$(String) - find all elements matching given descriptor.Also important simplified methods:
sendKeys(CharSequence...) - sends a string to current window using keyboard.open(String) - opens a specified URL or application.window(String) - switches to a window with a specified title or descriptor.timeouts(long) - sets the maximum amount of time to wait for condition,
page load, script to execute, element search.The following additional methods are implemented for desktopDriver:
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_COPY_SELECTED_TEXT |
static java.lang.String |
ACTION_GET_CLIPBOARD_TEXT |
static java.lang.String |
ACTION_PUTTY_COPY_ALL_TEXT |
static java.lang.String |
ACTION_SELECT_ALL_TEXT_AND_COPY |
static long |
SWITCH_WINDOW_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
static UiElement |
$(By seleniumSelector)
Finds the first element matching given descriptor
|
static UiElement |
$(By seleniumSelector,
int index)
Driver Type: Desktop, Web
|
static UiElement |
$(WebElement webElement)
Wraps standard Selenium WebElement into UiElement
to use additional methods like shouldHave(), selectOption(), etc.
|
static UiElementCollection |
$$(By seleniumSelector)
Find all elements matching given descriptor.
|
static UiElementCollection |
$$(java.util.Collection<? extends WebElement> elements)
Initializes collection with Elements
|
static UiElementCollection |
$$(java.lang.String cssSelector)
Finds all elements matching given CSS selector.
|
static WFActions |
actions()
With this method you can use Selenium Actions like described in the
AdvancedUserInteractions page.
|
static void |
back()
Desktop: moves back to preview window in desktopDriver history
|
static void |
cleanClipboard()
Clean clipboard.
|
static RobotClipboard |
clipboard()
Returns clipboard implementation based on the settings
|
static java.lang.String |
clipboardText()
Returns text from RPA agent clipboard
|
static void |
close()
Closes the current window.
|
static java.lang.String |
confirm()
Accepts (Clicks "Yes" or "Ok") in the existing confirmation dialog (javascript 'alert' or 'confirm').
|
static java.lang.String |
confirm(java.lang.String expectedDialogText)
Accepts (Clicks "Yes" or "Ok") in the existing confirmation dialog (javascript 'alert' or 'confirm').
|
static java.lang.String |
copyPuttyWindowText()
Copies all text in PuTTY window.
|
static java.lang.String |
copySelectedText()
Copies currently selected text and returns it.
|
static boolean |
deleteFileOnAgent(java.lang.String filePath)
Deletes file or folder on RPA Agent machine
|
static void |
disableTypeOnScreen()
Sets an option typeOnScreen is FALSE to a desktop driver
|
static java.lang.String |
dismiss()
Dismisses (clicks "No" or "Cancel") in the existing confirmation dialog (javascript 'alert' or 'confirm').
|
static java.lang.String |
dismiss(java.lang.String expectedDialogText)
Dismisses (clicks "No" or "Cancel") in the existing confirmation dialog (javascript 'alert' or 'confirm').
|
static byte[] |
downloadFileFromAgent(java.lang.String filePath)
Downloads file from RPA Agent machine
|
static java.lang.String |
downloadFileOnAgent(java.lang.String downloadLink)
Downloads a file and saves it on RPA agent machine (in default temp folder)
|
static java.lang.String |
downloadFileOnAgent(java.lang.String downloadLink,
java.lang.String filePath)
Downloads a file and saves it on RPA agent machine
|
static java.lang.String |
downloadTextFileFromAgent(java.lang.String filePath)
Downloads text file from RPA Agent machine
|
static com.workfusion.rpa.driver.Driver |
driver()
Short definition for accessing current driver instance.
|
static void |
enableTypeOnScreen()
Sets an option typeOnScreen is TRUE to a desktop driver
|
static boolean |
exists(By selector)
Checks if element exists on the current page.
|
static boolean |
exists(java.lang.String cssSelector)
Checks if element exists on the current page.
|
static <any> |
fluentWait()
Creates an org.openqa.selenium.support.ui.FluentWait instance with Selenide timeout/polling.
|
static void |
forward()
Desktop: moves forward to next window in desktopDriver history
|
static java.util.List<java.lang.String> |
getDriverLogs(LogType logType)
Deprecated.
|
static java.util.List<java.lang.String> |
getDriverLogs(LogType logType,
java.util.logging.Level logLevel)
Deprecated.
|
static UiElement |
getElement(By criteria)
Finds the first element matching given criteria
|
static UiElement |
getElement(By criteria,
int index)
Finds the Nth element matching given criteria
|
static UiElementCollection |
getElements(By criteria)
Finds all elements matching given descriptor
|
static long |
getFluentWaitPollingInterval()
Returns the frequency with which to check the condition, for example in:
|
static long |
getFluentWaitTimeout()
Returns the maximum amount of time to wait for a condition, for example in:
|
static UiElement |
getFocusedElement()
Returns the currently focused UiElement,
that is, the element that will get keystroke events if the user types any.
|
static org.openqa.selenium.WebDriver.Timeouts |
implicitlyWaitTimeout(long milliseconds)
Sets the maximum amount of time to wait for element search
|
static void |
inChrome(<any> closure)
Is used for explicitly Chrome driver choosing.
|
static void |
inDesktop(<any> closure)
Is used for explicitly Desktop driver choosing.
|
static void |
inEdge(<any> closure)
Is used for explicitly Edge driver choosing.
|
static void |
inEdgeInIEMode(<any> closure)
Is used for explicitly Edge driver choosing.
|
static void |
inFirefox(<any> closure)
Is used for explicitly Firefox driver choosing.
|
static void |
inIE(<any> closure)
Is used for explicitly IE driver choosing.
|
static boolean |
isOptionEnabled(java.lang.String key)
Checks if an option related to a desktop driver is enabled
|
static RobotsKeyboard |
keyboard()
Short definition for accessing current driver keyboard.
|
static void |
minimizeWindow()
Minimizes current window
|
static RobotsMouse |
mouse()
Short definition for accessing current driver mouse.
|
static java.lang.Integer |
open(java.lang.Object target)
Opens a specified URL or application
|
static java.lang.Integer |
open(java.lang.String target)
Opens a specified URL or application
|
static void |
open(java.net.URL absoluteUrl)
Opens a specified absolute URL
|
static java.lang.Integer |
openAndFocus(java.lang.String path2launch,
long timeout,
long polling)
Opens a specified URL or application and sets focus
|
static void |
openChrome(java.lang.String target)
Opens a specified URL in Chrome browser
|
static void |
openEdge(java.lang.String target)
Opens a specified URL in Edge browser
|
static void |
openEdgeInIEMode(java.lang.String target)
Opens a specified URL in Edge browser in IE mode
|
static void |
openFirefox(java.lang.String target)
Opens a specified URL in Firefox browser
|
static void |
openIE(java.lang.String target)
Opens a specified URL in IE browser
|
static java.lang.String |
openLinkInNewWindow(By by)
Opens the specified link in a new browser's tab.
|
static java.lang.String |
openLinkInNewWindow(java.lang.String url)
Opens the link in a new browser's tab.
|
static java.lang.String |
openNewWindow()
Opens a new browser's tab.
|
static org.openqa.selenium.WebDriver.Timeouts |
pageLoadTimeout(long milliseconds)
Sets the maximum amount of time to wait for page to load
|
static void |
pressAltF4()
Send ALT+F4 to the current window.
|
static void |
pressBackSpace()
Send BACK_SPACE to the current window.
|
static void |
pressCtrlA()
Send CTRL+A to the current window.
|
static void |
pressCtrlC()
Send CTRL+C to the current window.
|
static void |
pressCtrlShiftZ()
Send CTRL+SHIFT+Z to the current window.
|
static void |
pressCtrlV()
Send CTRL+V to the current window.
|
static void |
pressCtrlX()
Send CTRL+X to the current window.
|
static void |
pressCtrlZ()
Send CTRL+Z to the current window.
|
static void |
pressEnter()
Sends ENTER to the current window.
|
static void |
pressEscape()
Sends ESCAPE to the current window.
|
static void |
pressSpace()
Sends SPACE to the current window.
|
static void |
pressTab()
Sends TAB to the current window.
|
static void |
refresh()
Refreshes the current page
|
static java.awt.image.BufferedImage |
screenshotAsImage()
Takes a screenshot of the current window
|
static org.openqa.selenium.WebDriver.Timeouts |
scriptTimeout(long milliseconds)
Sets the maximum amount of time to wait for script execution
|
static java.lang.String |
selectAllTextAndCopy()
Select all text in current window and copies it to clipboard.
|
static void |
sendKeys(java.lang.CharSequence... charSequences)
Sends a string to current window using keyboard.
|
static void |
sendKeys(java.lang.Object text)
Sends a string to current window using keyboard.
|
static java.lang.String |
sendToAgent(byte[] fileData)
Sends file to RPA Agent default temp folder.
|
static java.lang.String |
sendToAgent(byte[] fileData,
java.lang.String filePath)
Sends file-data to RPA Agent.
|
static java.lang.String |
sendToAgent(byte[] fileData,
java.lang.String filePrefix,
java.lang.String fileSuffix)
Sends file-data to RPA Agent, create temporary file
|
static java.lang.String |
sendToAgent(java.lang.String textContent)
Sends file to RPA Agent default temp folder.
|
static java.lang.String |
sendToAgent(java.lang.String textContent,
java.lang.String filePath)
Sends file-data to RPA Agent.
|
static void |
setClipboardText(java.lang.String text)
Sets text to RPA agent clipboard
|
static void |
setFluentWaitPollingInterval(long fluentWaitPollingInterval)
Sets The frequency with which to check the condition, for example in:
|
static void |
setFluentWaitTimeout(long fluentWaitTimeout)
Sets the maximum amount of time to wait for a condition, for example in:
|
static void |
setImageMatchingOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Sets the Image Matching Options
|
static void |
setOption(java.lang.String key,
boolean value)
Sets an option related to a desktop driver
|
static void |
setReturnTypeAsJSON()
Sets an option returnType is JSON to a desktop driver
|
static void |
setReturnTypeAsString()
Sets an option returnType is STRING to a desktop driver
|
static void |
sleep(long milliseconds)
Wait for a specified number of milliseconds before the next step.
|
static WebDriver |
switchSendRawKeysMode(boolean enable)
Enables/disables sending keys as is (raw keys mode) or as with handling special keys (CTRL, SHIFT, etc).
|
static WebDriver.TargetLocator |
switchTo()
Switch to window/tab/frame/parentFrame/innerFrame/alert.
|
static org.openqa.selenium.WebDriver.Window |
switchToExistingWindow(java.lang.String titleOrDescriptor)
Switches to a existing window with a specified title or descriptor
Sample
switchToExistingWindow("[CLASS:Notepad]")
|
static org.openqa.selenium.WebDriver.Window |
switchToExistingWindow(java.lang.String titleOrDescriptor,
java.lang.Long timeoutInMillis)
Switches to a existing window with a specified title or descriptor
Sample
switchToExistingWindow("[CLASS:Notepad]", 100L)
|
static java.lang.String |
switchToLastWindow()
Deprecated.
As of Release 9.1, since window switching algorithm works by default with all opened windows |
static java.lang.String |
switchToNextWindow()
Deprecated.
As of Release 9.1, since window switching algorithm works by default with all opened windows |
static java.lang.String |
switchToPrevWindow()
Deprecated.
As of Release 9.1, since window switching algorithm works by default with all opened windows |
static java.lang.String |
switchToRootWindow()
Deprecated.
As of Release 9.1, since window switching algorithm works by default with all opened windows |
static org.openqa.selenium.WebDriver.Timeouts |
timeouts()
Driver Type: Desktop, Web
|
static org.openqa.selenium.WebDriver.Timeouts |
timeouts(long milliseconds)
Sets the maximum amount of time to wait for:
condition
page load
script to execute
element search
|
static java.lang.String |
title()
Returns the title of the current page.
|
static <any> |
Wait()
Deprecated.
As of Release 9.2, please use fluentWait() instead |
static org.openqa.selenium.WebDriver.Window |
window()
Returns the current window
Sample
window().fullscreen();
|
static org.openqa.selenium.WebDriver.Window |
window(java.lang.String titleOrDescriptor)
Switches to a window with a specified title or descriptor
Sample
window("[CLASS:Notepad]")
|
static void |
zoom(double factor)
Zoom the current page (in or out).
|
public static final java.lang.String ACTION_GET_CLIPBOARD_TEXT
public static final java.lang.String ACTION_COPY_SELECTED_TEXT
public static final java.lang.String ACTION_SELECT_ALL_TEXT_AND_COPY
public static final java.lang.String ACTION_PUTTY_COPY_ALL_TEXT
public static final long SWITCH_WINDOW_TIMEOUT
public static com.workfusion.rpa.driver.Driver driver()
Driver Type: Desktop, Web
RemoteWebDriverpublic static RobotsKeyboard keyboard()
keyboard().sendKeys(Keys.TAB); Driver Type: Desktop, Web
Keyboardpublic static RobotsMouse mouse()
mouse().doubleClick(20, 40).contextClick(100, 78); Driver Type: Desktop, Web
Mousepublic static WebDriver.TargetLocator switchTo()
Switch to window/tab/frame/parentFrame/innerFrame/alert.
Similar to org.openqa.selenium.WebDriver#switchTo()
switchTo().window("[CLASS:Notepad]").close(); Driver Type: Desktop, Web
public static org.openqa.selenium.WebDriver.Window window()
window().fullscreen(); Driver Type: Desktop, Web
org.openqa.selenium.WebDriver.Windowpublic static void minimizeWindow()
Driver Type: Desktop
public static org.openqa.selenium.WebDriver.Window switchToExistingWindow(java.lang.String titleOrDescriptor,
java.lang.Long timeoutInMillis)
switchToExistingWindow("[CLASS:Notepad]", 100L) Driver Type: Desktop
titleOrDescriptor - string representation of a window title or descriptortimeoutInMillis - timeout in milliseconds for find last open windowpublic static org.openqa.selenium.WebDriver.Window switchToExistingWindow(java.lang.String titleOrDescriptor)
switchToExistingWindow("[CLASS:Notepad]") Driver Type: Desktop
titleOrDescriptor - string representation of a window title or descriptorpublic static org.openqa.selenium.WebDriver.Window window(java.lang.String titleOrDescriptor)
window("[CLASS:Notepad]") Driver Type: Desktop, Web
titleOrDescriptor - string representation of a window title or descriptorpublic static void sendKeys(java.lang.Object text)
Sends a string to current window using keyboard.
Delegates invocation to driver.getKeyboard().sendKeys(...)
Driver Type: Desktop, Web
text - can be a Collection or Array, all items will be concatenatedpublic static void sendKeys(java.lang.CharSequence... charSequences)
Sends a string to current window using keyboard.
Delegates invocation to driver.getKeyboard().sendKeys(...)
Driver Type: Desktop, Web
charSequences - can be a Char Sequence (ex. String, Keys.CHAR), all items will be concatenatedpublic static void pressEnter()
pressEnter();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.ENTER)
Driver Type: Desktop, Web
public static void pressTab()
pressTab();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.TAB)
Driver Type: Desktop, Web
public static void pressEscape()
pressEscape();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.ESCAPE)
Driver Type: Desktop, Web
public static void pressSpace()
pressSpace();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.SPACE)
Driver Type: Desktop, Web
public static void pressBackSpace()
pressBackSpace();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.BACK_SPACE)
Driver Type: Desktop, Web
public static void pressCtrlA()
pressCtrlA();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, "a"))
Driver Type: Desktop, Web
public static void pressCtrlC()
pressCtrlC();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, "c"))
Driver Type: Desktop, Web
public static void pressCtrlV()
pressCtrlV();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, "v"))
Driver Type: Desktop, Web
public static void pressCtrlX()
pressCtrlX();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, "x"))
Driver Type: Desktop, Web
public static void pressCtrlZ()
pressCtrlZ();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, "z"))
Driver Type: Desktop, Web
public static void pressCtrlShiftZ()
pressCtrlShiftZ();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.CONTROL, Keys.SHIFT, "z"))
Driver Type: Desktop, Web
public static void pressAltF4()
pressAltF4();
Implementation details: This is the same as
driver().getKeyboard().sendKeys(Keys.chord(Keys.ALT, Keys.F4))
Driver Type: Desktop, Web
public static java.lang.Integer openAndFocus(java.lang.String path2launch,
long timeout,
long polling)
Object calculator = "calc.exe"; openAndFocus(calculator, 1000, 250);
Driver Type: Desktop
path2launch - Application pathtimeout - Timeout during driver try get focus in millisecondspolling - Polling interval in millisecondspublic static java.lang.Integer open(java.lang.Object target)
Object calculator = "calc.exe"; open(calculator);
Driver Type: Desktop, Web
target - object that will be converted to Stringpublic static java.lang.Integer open(java.lang.String target)
open("calc.exe");
Driver Type: Desktop, Web
target - String with URL or application pathpublic static void openFirefox(java.lang.String target)
open("https://workfusion.com");
Driver Type: Universal
target - String with URLpublic static void inFirefox(<any> closure)
inFirefox() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inFirefox{
inChrome() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using Firefox driverpublic static void openIE(java.lang.String target)
open("https://workfusion.com");
Driver Type: Universal
target - String with URLpublic static void inIE(<any> closure)
inIE() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inIE{
inChrome() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using IE driverpublic static void openChrome(java.lang.String target)
open("https://workfusion.com");
Driver Type: Universal
target - String with URLpublic static void openEdge(java.lang.String target)
open("https://workfusion.com");
Driver Type: Universal
target - String with URLpublic static void openEdgeInIEMode(java.lang.String target)
open("https://workfusion.com");
Driver Type: Universal
target - String with URLpublic static void inChrome(<any> closure)
inChrome() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inChrome{
inDesktop() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using Chrome driverpublic static void inDesktop(<any> closure)
inDesktop() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inDesktop{
inChrome() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using Desktop driverpublic static void inEdge(<any> closure)
inEdge() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inEdge{
inChrome() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using Edge driverpublic static void inEdgeInIEMode(<any> closure)
inEdgeInIEMode() {
open("https://workfusion.com")
}
Such constructions are not supported e.g
inEdgeInIEMode{
inChrome() {
open("https://workfusion.com")
}
}
Driver Type: Universal
closure - code that will be executed using Edge driverpublic static void open(java.net.URL absoluteUrl)
open(new URL("https://workfusion.com"));
Driver Type: Web
absoluteUrl - String with absolute URLpublic static void close()
Closes the current window.
This is the same as:
driver.close();
Driver Type: Desktop, Web
public static void refresh()
Refreshes the current page
This is the same as:
driver.navigate().refresh();
Driver Type: Web
public static void back()
Desktop: moves back to preview window in desktopDriver history
Web: moves back a single item in the browser's history.
Driver Type: Desktop, Web
This is the same as:
driver.navigate().back();
public static void forward()
Desktop: moves forward to next window in desktopDriver history
Web: moves a single item forward in the browser's history.
Driver Type: Desktop, Web
This is the same as:
driver.navigate().forward();
public static java.lang.String title()
Returns the title of the current page.
This is the same as:
driver.title();
Driver Type: Desktop, Web
public static void sleep(long milliseconds)
Wait for a specified number of milliseconds before the next step.
This is the same as:
Thread.sleep(milliseconds);
Driver Type: Desktop, Web
milliseconds - time to sleep in millisecondspublic static UiElement $(WebElement webElement)
Driver Type: Desktop, Web
webElement - standard Selenium WebElementUiElementpublic static boolean exists(java.lang.String cssSelector)
Driver Type: Desktop, Web
cssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"public static boolean exists(By selector)
Driver Type: Desktop, Web
selector - any selector like:By.id(), By.name(), By.cssSelector("[CLASS:Edit; INSTANCE:1]")public static UiElement $(By seleniumSelector)
Driver Type: Desktop, Web
seleniumSelector - any selector like:By.id(), By.name(), By.cssSelector("[CLASS:Edit; INSTANCE:1]")public static UiElement $(By seleniumSelector, int index)
Driver Type: Desktop, Web
getElement(By, int)public static UiElementCollection $$(java.util.Collection<? extends WebElement> elements)
Driver Type: Desktop, Web
elements - Collection of standard Selenium WebElements$(WebElement)public static UiElementCollection $$(java.lang.String cssSelector)
Driver Type: Desktop, Web
cssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"#$(String)public static UiElementCollection $$(By seleniumSelector)
Driver Type: Desktop, Web
seleniumSelector - any selector like:By.id(), By.name(), By.cssSelector("[CLASS:Edit; INSTANCE:1]")$(By)public static UiElement getElement(By criteria)
Driver Type: Desktop, Web
criteria - instance of By: By.id(), By.className() etc.public static UiElement getElement(By criteria, int index)
Driver Type: Desktop, Web
criteria - instance of By: By.id(), By.className() etc.index - 0..Njava.lang.IndexOutOfBoundsException - if the specified index does not existpublic static UiElementCollection getElements(By criteria)
Driver Type: Desktop, Web
criteria - instance of By: By.id(), By.className() etc.public static java.lang.String confirm()
Driver Type: Web
org.openqa.selenium.TimeoutException - if dialog is not shownpublic static java.lang.String confirm(java.lang.String expectedDialogText)
Driver Type: Web
expectedDialogText - if not null, checks that confirmation dialog displays this message (case-sensitive)java.lang.IllegalStateException - if confirmation message differs from expected messageorg.openqa.selenium.TimeoutException - if dialog is not shownpublic static java.lang.String dismiss()
Driver Type: Web
org.openqa.selenium.TimeoutException - if dialog is not shownpublic static java.lang.String dismiss(java.lang.String expectedDialogText)
Driver Type: Web
expectedDialogText - if not null, checks that confirmation dialog displays this message (case-sensitive)java.lang.IllegalStateException - if confirmation message differs from expected messageorg.openqa.selenium.TimeoutException - if dialog is not shownpublic static UiElement getFocusedElement()
Driver Type: Web
getFocusedElement().sendKeys(Keys.ENTER); @Deprecated public static <any> Wait()
As of Release 9.2, please use fluentWait() instead
Wait().until(invisibilityOfElementLocated(By.id("magic-id"))); Driver Type: Desktop, Web
getFluentWaitPollingInterval(),
getFluentWaitTimeout()public static <any> fluentWait()
fluentWait().until(invisibilityOfElementLocated(By.id("magic-id"))); Driver Type: Desktop, Web
getFluentWaitPollingInterval(),
getFluentWaitTimeout()public static WFActions actions()
actions()
.sendKeys($(By.name("rememberMe")), "John")
.click($(#rememberMe"))
.click($(byText("Login")))
.build()
.perform();
Driver Type: Desktop, Web
public static void zoom(double factor)
Driver Type: Web
factor - e.g. 1.1 or 2.0 or 0.5@Deprecated public static java.util.List<java.lang.String> getDriverLogs(LogType logType)
Driver Type: Web
getDriverLogs(LogType, Level)@Deprecated public static java.util.List<java.lang.String> getDriverLogs(LogType logType, java.util.logging.Level logLevel)
for(String logEntry : getDriverLogs(LogType.BROWSER, Level.ALL)) {
Reporter.log(logEntry + "<br>");
}
Note that currently "manage().logs()" is in the Beta stage.
Driver Type: Web
logType - WebDriver supported log types seelogLevel - logging level that will be used to control logging outputLogType,
Level@Deprecated public static java.lang.String switchToRootWindow()
As of Release 9.1, since window switching algorithm works by default with all opened windows
@Deprecated public static java.lang.String switchToLastWindow()
As of Release 9.1, since window switching algorithm works by default with all opened windows
@Deprecated public static java.lang.String switchToPrevWindow()
As of Release 9.1, since window switching algorithm works by default with all opened windows
@Deprecated public static java.lang.String switchToNextWindow()
As of Release 9.1, since window switching algorithm works by default with all opened windows
public static java.lang.String openNewWindow()
Driver Type: Web
public static java.lang.String openLinkInNewWindow(java.lang.String url)
Driver Type: Web
public static java.lang.String openLinkInNewWindow(By by)
Driver Type: Web
openLinkInNewWindow(byCssSelector(".container a.create-new")).switchTo(); by - - link descriptorpublic static long getFluentWaitTimeout()
Wait().until(<some_condition>);
$(".demo-el").waitUntil(<other_condition>);
Driver Type: Desktop, Web
public static void setFluentWaitTimeout(long fluentWaitTimeout)
Wait().until(<some_condition>);
$(".demo-el").waitUntil(<other_condition>);
Driver Type: Desktop, Web
fluentWaitTimeout - timeout in millisecondspublic static long getFluentWaitPollingInterval()
Wait().until(<some_condition>);
$(".demo-el").waitUntil(<other_condition>);
Driver Type: Desktop, Web
public static void setFluentWaitPollingInterval(long fluentWaitPollingInterval)
Wait().until(<some_condition>);
$(".demo-el").waitUntil(<other_condition>);
Driver Type: Desktop, Web
fluentWaitPollingInterval - frequency in millisecondspublic static org.openqa.selenium.WebDriver.Timeouts timeouts()
Driver Type: Desktop, Web
public static org.openqa.selenium.WebDriver.Timeouts timeouts(long milliseconds)
Driver Type: Desktop, Web
milliseconds - timeout in millisecondssetFluentWaitTimeout(long),
implicitlyWaitTimeout(long),
pageLoadTimeout(long),
scriptTimeout(long)public static org.openqa.selenium.WebDriver.Timeouts implicitlyWaitTimeout(long milliseconds)
Driver Type: Desktop, Web
milliseconds - timeout in millisecondsorg.openqa.selenium.WebDriver.Timeouts#implicitlyWait(Duration)public static org.openqa.selenium.WebDriver.Timeouts pageLoadTimeout(long milliseconds)
Driver Type: Desktop, Web
milliseconds - timeout in millisecondsorg.openqa.selenium.WebDriver.Timeouts#pageLoadTimeout(Duration)public static org.openqa.selenium.WebDriver.Timeouts scriptTimeout(long milliseconds)
Driver Type: Desktop, Web
milliseconds - timeout in millisecondsorg.openqa.selenium.WebDriver.Timeouts#scriptTimeout(Duration)public static void setImageMatchingOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Driver Type: Desktop/p>
options - key-values optionspublic static java.awt.image.BufferedImage screenshotAsImage()
Driver Type: Web
public static RobotClipboard clipboard()
Driver Type: Desktop
public static void cleanClipboard()
Driver Type: Desktop
setClipboardText(String)public static java.lang.String clipboardText()
Driver Type: Desktop
public static java.lang.String copySelectedText()
Driver Type: Desktop
public static java.lang.String selectAllTextAndCopy()
Driver Type: Desktop
public static void setClipboardText(java.lang.String text)
Driver Type: Desktop
text - text to set in clipboardpublic static java.lang.String copyPuttyWindowText()
window("[CLASS:PuTTY]");sendKeys("vim 123.txt", Keys.ENTER);copyPuttyWindowText();Driver Type: Desktop
specially implemented for PuTTY, fully supported for PuTTY starting from v.0.67
public static java.lang.String sendToAgent(java.lang.String textContent)
Driver Type: Desktop
textContent - file text contentpublic static java.lang.String sendToAgent(byte[] fileData)
Driver Type: Desktop
fileData - byte arraypublic static java.lang.String sendToAgent(java.lang.String textContent,
java.lang.String filePath)
Driver Type: Desktop
textContent - file text contentfilePath - path to save the filepublic static java.lang.String sendToAgent(byte[] fileData,
java.lang.String filePath)
Driver Type: Desktop
fileData - byte arrayfilePath - path to save the filepublic static java.lang.String sendToAgent(byte[] fileData,
java.lang.String filePrefix,
java.lang.String fileSuffix)
Driver Type: Desktop
fileData - byte arrayfilePrefix - prefix for file namefileSuffix - postfix for file name. Can be extension if starts from dot (.txt)public static byte[] downloadFileFromAgent(java.lang.String filePath)
Note: this method is intended for simple cases where it is convenient to read all bytes into a byte array. It is not intended for reading large files.
Driver Type: Desktop
filePath - specifies path to the file that will be downloadedjava.lang.OutOfMemoryError - if an array of the required size cannot be allocated, for
example the file is larger that 2GBpublic static java.lang.String downloadTextFileFromAgent(java.lang.String filePath)
Driver Type: Desktop
filePath - specifies path to the file that will be downloadeddownloadFileFromAgent(String)public static boolean deleteFileOnAgent(java.lang.String filePath)
Driver Type: Desktop
filePath - specifies path to the file or folder that will be deletedpublic static java.lang.String downloadFileOnAgent(java.lang.String downloadLink)
Driver Type: Desktop
downloadLink - link to download the filepublic static java.lang.String downloadFileOnAgent(java.lang.String downloadLink,
java.lang.String filePath)
Driver Type: Desktop
downloadLink - link to download the filefilePath - specifies folder to save filepublic static WebDriver switchSendRawKeysMode(boolean enable)
Driver Type: Desktop
enable - - true - send as raw keys; false - send as special keys;public static void setOption(java.lang.String key,
boolean value)
Driver Type: Desktop
key - option keyvalue - option valuepublic static boolean isOptionEnabled(java.lang.String key)
Driver Type: Desktop
key - option keypublic static void enableTypeOnScreen()
Driver Type: Desktop
Enabling this option makes your automation less stable in case some popup windows appear.
public static void disableTypeOnScreen()
Driver Type: Desktop
public static void setReturnTypeAsJSON()
Driver Type: Desktop
public static void setReturnTypeAsString()
Driver Type: Desktop
Copyright © 2024 WorkFusion, Inc. All rights reserved.