Package org.kquiet.browser
Interface ActionRunner
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
BasicActionRunner
ActionRunner is resposible to run a browser through Selenium and execute actions
against it. With its methods of executeComposer and executeAction, users can run
ActionComposer, or customized actions with priority.- Author:
- Kimberly
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()executeAction(Runnable browserAction, int priority) Execute browser action with specified priority.executeComposer(ActionComposer actionComposer) Execute givenActionComposer.getName()Get the name of thisActionRunner.Get the identity of root window(the initial window as the browser started).org.openqa.selenium.WebDriverGet associatedWebDriver.booleanCheck whether browser is still running.booleanisPaused()Check whether thisActionRunneris paused or not.voidpause()Stop executing any newly incomingActionComposeror browser action, but the running ones may or may not keep running(depends on implementation).voidresume()Resume to acceptActionComposeror browser action (if any).Set the name of thisActionRunner.
-
Method Details
-
getName
String getName()Get the name of thisActionRunner.- Returns:
- name represented as
String
-
setName
Set the name of thisActionRunner.- Parameters:
name- the name to set- Returns:
- this
ActionRunner
-
getRootWindowIdentity
String getRootWindowIdentity()Get the identity of root window(the initial window as the browser started).- Returns:
- identity represented as
String
-
executeAction
Execute browser action with specified priority.- Parameters:
browserAction- browser action to executepriority- priority of action- Returns:
- a
CompletableFuturerepresenting the pending completion of given browser action
-
executeComposer
Execute givenActionComposer.- Parameters:
actionComposer-ActionComposerto execute- Returns:
- a
CompletableFuturerepresenting the pending completion of givenActionComposer
-
getWebDriver
org.openqa.selenium.WebDriver getWebDriver()Get associatedWebDriver.- Returns:
- the
WebDriverthisActionRunneris using
-
isBrowserAlive
boolean isBrowserAlive()Check whether browser is still running.- Returns:
trueif the browser is still running;falseotherwise
-
pause
void pause()Stop executing any newly incomingActionComposeror browser action, but the running ones may or may not keep running(depends on implementation). -
resume
void resume()Resume to acceptActionComposeror browser action (if any). -
isPaused
boolean isPaused()Check whether thisActionRunneris paused or not.- Returns:
trueif paused;falseotherwise
-
close
void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-