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 TypeMethodDescriptionvoid
close()
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.WebDriver
Get associatedWebDriver
.boolean
Check whether browser is still running.boolean
isPaused()
Check whether thisActionRunner
is paused or not.void
pause()
Stop executing any newly incomingActionComposer
or browser action, but the running ones may or may not keep running(depends on implementation).void
resume()
Resume to acceptActionComposer
or 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
CompletableFuture
representing the pending completion of given browser action
-
executeComposer
Execute givenActionComposer
.- Parameters:
actionComposer
-ActionComposer
to execute- Returns:
- a
CompletableFuture
representing the pending completion of givenActionComposer
-
getWebDriver
org.openqa.selenium.WebDriver getWebDriver()Get associatedWebDriver
.- Returns:
- the
WebDriver
thisActionRunner
is using
-
isBrowserAlive
boolean isBrowserAlive()Check whether browser is still running.- Returns:
true
if the browser is still running;false
otherwise
-
pause
void pause()Stop executing any newly incomingActionComposer
or browser action, but the running ones may or may not keep running(depends on implementation). -
resume
void resume()Resume to acceptActionComposer
or browser action (if any). -
isPaused
boolean isPaused()Check whether thisActionRunner
is paused or not.- Returns:
true
if paused;false
otherwise
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-