Interface Context

All Superinterfaces:
SubCommandMapProvider, org.openqa.selenium.WrapsDriver
All Known Implementing Classes:
NullContext, Runner

public interface Context
extends org.openqa.selenium.WrapsDriver, SubCommandMapProvider
Selenese Runner Context.
  • Method Details

    • prepareWebDriver

      void prepareWebDriver()
      Prepare WebDriver.
    • getBrowserName

      default String getBrowserName()
      Get browser name.
      Returns:
      browser name.
    • isBrowser

      default boolean isBrowser​(String name)
      Test browser name.
      Parameters:
      name - browser name.
      Returns:
      true if match browser name.
    • getCurrentTestCase

      TestCase getCurrentTestCase()
      Get current test-case.
      Returns:
      current test-case.
    • setCurrentTestCase

      void setCurrentTestCase​(TestCase testCase)
      Set current test-case.
      Parameters:
      testCase - current test-case.
    • getPrintStream

      PrintStream getPrintStream()
      Get PrintStream for logging.
      Returns:
      PrintStram object.
    • getOverridingBaseURL

      String getOverridingBaseURL()
      Get base URL for overriding test-case base URL.
      Returns:
      base URL.
    • getCurrentBaseURL

      String getCurrentBaseURL()
      Get current base URL.
      Returns:
      base URL.
    • getCommandFactory

      ICommandFactory getCommandFactory()
      Get CommandFactory instance.
      Returns:
      CommandFactory instance.
    • getCommandListIterator

      CommandListIterator getCommandListIterator()
      Get current CommandListIterator.
      Returns:
      current CommanListIterator.
    • pushCommandListIterator

      void pushCommandListIterator​(CommandListIterator commandListIterator)
      Push CommandListIterator.
      Parameters:
      commandListIterator - CommanListIterator.
    • popCommandListIterator

      void popCommandListIterator()
      Pop CommandListIterator.
    • getVarsMap

      VarsMap getVarsMap()
      Get variables map.
      Returns:
      VarsMap.
    • getTestCaseMap

      default TestCaseMap getTestCaseMap()
      Get test-case map.
      Returns:
      test-case map.
    • setTestCaseMap

      default void setTestCaseMap​(TestCaseMap testCaseMap)
      Set test-case map.
      Parameters:
      testCaseMap - test-case map.
    • getFlowControlState

      default <T extends FlowControlState> T getFlowControlState​(ICommand command)
      Get flow control state.
      Type Parameters:
      T - the class implements FlowControlState.
      Parameters:
      command - flow control command.
      Returns:
      flow control state.
    • setFlowControlState

      default <T extends FlowControlState> void setFlowControlState​(ICommand command, T state)
      Set flow control state.
      Type Parameters:
      T - the class implements FlowControlState.
      Parameters:
      command - flow control command.
      state - flow control state.
    • getRollupRules

      RollupRules getRollupRules()
      Get rollup rules.
      Returns:
      RollupRules object.
    • getCollectionMap

      CollectionMap getCollectionMap()
      Get collection map.
      Returns:
      CollectionMap.
    • getInitialWindowHandle

      String getInitialWindowHandle()
      Get initial window handle.
      Returns:
      window handle.
    • getElementFinder

      WebDriverElementFinder getElementFinder()
      Get elemnt finder.
      Returns:
      element finder.
    • findElements

      default List<org.openqa.selenium.WebElement> findElements​(String locator)
      Find elements
      Parameters:
      locator - locator.
      Returns:
      list of found elements. (empty if no element)
    • findElement

      default org.openqa.selenium.WebElement findElement​(String locator)
      Find an element
      Parameters:
      locator - locator.
      Returns:
      found element.
      Throws:
      org.openqa.selenium.NoSuchElementException - throw if element not found.
    • getEval

      Eval getEval()
      Get evaluater.
      Returns:
      eval object.
    • isTrue

      boolean isTrue​(String expr)
      Get boolean value of expr.
      Parameters:
      expr - expression.
      Returns:
      cast from result of expr to Javascript Boolean.
    • getTimeout

      int getTimeout()
      Get timeout for waiting. (ms)
      Returns:
      timeout for waiting.
    • setTimeout

      void setTimeout​(int timeout)
      Set timeout for waiting. (ms)
      Parameters:
      timeout - for waiting.
    • resetSpeed

      void resetSpeed()
      Reset speed as initial speed.
    • getSpeed

      long getSpeed()
      Get speed for setSpeed command.
      Returns:
      speed.
    • setSpeed

      void setSpeed​(long speed)
      Set speed for setSpeed command.
      Parameters:
      speed - speed.
    • waitSpeed

      void waitSpeed()
      Wait according to speed setting.
    • getLatestPageInformation

      PageInformation getLatestPageInformation()
      Get latest page information.
      Returns:
      page information.
    • setLatestPageInformation

      void setLatestPageInformation​(PageInformation pageInformation)
      Set latest page information.
      Parameters:
      pageInformation - page information.
    • getLogFilter

      EnumSet<LogFilter> getLogFilter()
      Get list of disabled page information.
      Returns:
      list of disabled page information.
    • getCookieFilter

      CookieFilter getCookieFilter()
      Get cookie filter.
      Returns:
      cookie filter.
    • setCookieFilter

      void setCookieFilter​(CookieFilter cookieFilter)
      Set cookie filter.
      Parameters:
      cookieFilter - cookie filter.
    • getJSLibrary

      JSLibrary getJSLibrary()
      Get JavaScript library handler.
      Returns:
      JavaScript library handler.
    • setJSLibrary

      void setJSLibrary​(JSLibrary jsLibrary)
      Set JavaScript library handler.
      Parameters:
      jsLibrary - JavaScript library handler.
    • getModifierKeyState

      ModifierKeyState getModifierKeyState()
      Get modifier key state.
      Returns:
      modifier key state.
    • resetState

      void resetState()
      Reset internal state.
    • isInteractive

      @Deprecated boolean isInteractive()
      Get interactive.
      Returns:
      interactive.
    • getNextNativeAlertActionListener

      AlertActionListener getNextNativeAlertActionListener()
      Get next native alert action.
      Returns:
      next native alert state
    • isW3cAction

      default boolean isW3cAction()
      Is Action command W3C compatible?
      Returns:
      true if Action command is W3C compatible.
    • executeScript

      default <T> T executeScript​(String script, Object... args)
      Executes JavaScript in the context of the currently selected frame or window. see JavascriptExecutor.executeScript(String, Object...).
      Type Parameters:
      T - type of return value.
      Parameters:
      script - The JavaScript to execute
      args - The arguments to the script. May be empty
      Returns:
      One of Boolean, Long, String, List or WebElement. Or null.
    • executeAsyncScript

      default <T> T executeAsyncScript​(String script, Object... args)
      Executes JavaScript in the context of the currently selected frame or window. see JavascriptExecutor.executeAsyncScript(String, Object...).
      Type Parameters:
      T - type of return value.
      Parameters:
      script - The JavaScript to execute
      args - The arguments to the script. May be empty
      Returns:
      One of Boolean, Long, String, List or WebElement. Or null.
    • resetRetries

      default void resetRetries()
      Reset number of actually used retries.
    • incrementRetries

      default void incrementRetries()
      Increment number of actually used retries.
    • hasReachedMaxRetries

      default boolean hasReachedMaxRetries()
      True if number of actually used retries has reached maximum number of retries.
      Returns:
      true if retries has reached max retries.
    • getRetries

      default int getRetries()
      Get number of actually used retries.
      Returns:
      number of actually used retries.
    • getMaxRetries

      default int getMaxRetries()
      Get maximum number of retries allowed for a given test.
      Returns:
      the maximum number of retries allowed for a given test.
    • setMaxRetries

      default void setMaxRetries​(int maxRetries)
      Set the maximum number of retries allowed for a given test.
      Parameters:
      maxRetries - the maximum number of retries allowed for a given test.
    • setupMaxTimeTimer

      default void setupMaxTimeTimer​(long maxTime)
      Setup MaxTimeActiveTimer.
      Parameters:
      maxTime - the maxTime in milliseconds.
    • isReplaceAlertMethod

      default boolean isReplaceAlertMethod()
      Return whether to replace alert methods.
      Returns:
      true to replace alert method, false otherwise.
    • getInteractiveModeHandler

      default InteractiveModeHandler getInteractiveModeHandler()
      Get interactive mode handler.
      Returns:
      interactive mode handler.