Interface ActionRunner

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BasicActionRunner

public interface ActionRunner extends Closeable
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 Details

    • getName

      String getName()
      Get the name of this ActionRunner.
      Returns:
      name represented as String
    • setName

      ActionRunner setName(String name)
      Set the name of this ActionRunner.
      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

      CompletableFuture<Void> executeAction(Runnable browserAction, int priority)
      Execute browser action with specified priority.
      Parameters:
      browserAction - browser action to execute
      priority - priority of action
      Returns:
      a CompletableFuture representing the pending completion of given browser action
    • executeComposer

      CompletableFuture<Void> executeComposer(ActionComposer actionComposer)
      Execute given ActionComposer.
      Parameters:
      actionComposer - ActionComposer to execute
      Returns:
      a CompletableFuture representing the pending completion of given ActionComposer
    • getWebDriver

      org.openqa.selenium.WebDriver getWebDriver()
      Get associated WebDriver.
      Returns:
      the WebDriver this ActionRunner 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 incoming ActionComposer or browser action, but the running ones may or may not keep running(depends on implementation).
    • resume

      void resume()
      Resume to accept ActionComposer or browser action (if any).
    • isPaused

      boolean isPaused()
      Check whether this ActionRunner is paused or not.
      Returns:
      true if paused; false otherwise
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable