public class Operations extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Operations.DragAndDrop
internal implementation not be instantiated directly - Action of drag-and-drop
|
static class |
Operations.KeysDown
internal implementation not be instantiated directly - Action of key-down
|
static class |
Operations.KeysSender
internal implementation not be instantiated directly - Action of sending keys to browser
|
static class |
Operations.OperationFailedException |
static class |
Operations.ReleaseKey
internal implementation not be instantiated directly - Action of releasing a key (key up)
|
static class |
Operations.Scroll
internal implementation not be instantiated directly - Action of scroll
|
static class |
Operations.ScrollElement
internal implementation not be instantiated directly - Action of scroll within an element
|
| Constructor and Description |
|---|
Operations() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
doWithRetries(Callable<T> action,
int numberOfRetries,
int sleepInMillisec)
Retry an action up to a number of times, with delay after each time.
|
static void |
doWithRetries(Runnable action,
int numberOfRetries,
int sleepInMillisec)
Retry an action/assertion up to a number of times, with delay after each time.
|
public static void doWithRetries(Runnable action, int numberOfRetries, int sleepInMillisec)
doWithRetries(() -> assertThat(div.withClass("foo"), isDisplayedIn(browser)), 5, 10);
action - the action to try. It's a runnable - no input parapeters and does not return anything.numberOfRetries - - maximum number of retriessleepInMillisec - - delay between consecutive retriespublic static <T> T doWithRetries(Callable<T> action, int numberOfRetries, int sleepInMillisec) throws Exception
WebElement el = doWithRetries(() -> browser.find(div.withClass("foo"), 5, 10);
T - any type that the function returnsaction - the action to try. It has no input parameters, but returns a valuenumberOfRetries - - maximum number of retriessleepInMillisec - - delay between consecutive retriesException - the exception thrown by the last try in case it exceeded the number of retries.Copyright © 2019. All rights reserved.