Class TestBenchDriverProxy

java.lang.Object
com.vaadin.testbench.TestBenchDriverProxy
All Implemented Interfaces:
HasTestBenchCommandExecutor, org.openqa.selenium.HasCapabilities, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver, org.openqa.selenium.WrapsDriver

public class TestBenchDriverProxy extends Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.WrapsDriver, HasTestBenchCommandExecutor, org.openqa.selenium.HasCapabilities, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.JavascriptExecutor
  • Constructor Details

    • TestBenchDriverProxy

      protected TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface org.openqa.selenium.WebDriver
    • findElement

      public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By arg0)
      Specified by:
      findElement in interface org.openqa.selenium.SearchContext
      Specified by:
      findElement in interface org.openqa.selenium.WebDriver
    • findElements

      public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0)
      Specified by:
      findElements in interface org.openqa.selenium.SearchContext
      Specified by:
      findElements in interface org.openqa.selenium.WebDriver
    • get

      public void get(String arg0)
      Specified by:
      get in interface org.openqa.selenium.WebDriver
    • getCurrentUrl

      public String getCurrentUrl()
      Specified by:
      getCurrentUrl in interface org.openqa.selenium.WebDriver
    • getPageSource

      public String getPageSource()
      Specified by:
      getPageSource in interface org.openqa.selenium.WebDriver
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface org.openqa.selenium.WebDriver
    • getWindowHandle

      public String getWindowHandle()
      Specified by:
      getWindowHandle in interface org.openqa.selenium.WebDriver
    • getWindowHandles

      public Set<String> getWindowHandles()
      Specified by:
      getWindowHandles in interface org.openqa.selenium.WebDriver
    • manage

      public org.openqa.selenium.WebDriver.Options manage()
      Specified by:
      manage in interface org.openqa.selenium.WebDriver
    • quit

      public void quit()
      Specified by:
      quit in interface org.openqa.selenium.WebDriver
    • switchTo

      public org.openqa.selenium.WebDriver.TargetLocator switchTo()
      Specified by:
      switchTo in interface org.openqa.selenium.WebDriver
    • getCommandExecutor

      public TestBenchCommandExecutor getCommandExecutor()
      Description copied from interface: HasTestBenchCommandExecutor
      Return a reference to the related TestBenchCommandExecutor instance.
      Specified by:
      getCommandExecutor in interface HasTestBenchCommandExecutor
      Returns:
      the TestBenchCommandExecutor instance
    • getCapabilities

      public org.openqa.selenium.Capabilities getCapabilities()
      Specified by:
      getCapabilities in interface org.openqa.selenium.HasCapabilities
    • getWrappedDriver

      public org.openqa.selenium.WebDriver getWrappedDriver()
      Specified by:
      getWrappedDriver in interface org.openqa.selenium.WrapsDriver
    • wrapElementOrElements

      protected static Object wrapElementOrElements(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor)
      Wraps any WebElement found inside the object inside a TestBenchElement.

      Traverses through any List found inside the object and wraps any elements inside the list, recursively. The behavior is compatible with what executeScript(String, Object...) and executeAsyncScript(String, Object...) returns.

      Does not modify the argument, instead creates a new object containing the wrapped elements and other possible values.

      This method is protected for testing purposes only.

      Parameters:
      elementElementsOrValues - an object containing a WebElement, a List of WebElements or something completely different.
      tbCommandExecutor - the TestBenchCommandExecutor related to the driver instance
      Returns:
      a new object containing the wrapped elements and other possible values
    • executeScript

      public Object executeScript(String script, Object... args)
      Specified by:
      executeScript in interface org.openqa.selenium.JavascriptExecutor
    • executeAsyncScript

      public Object executeAsyncScript(String script, Object... args)
      Specified by:
      executeAsyncScript in interface org.openqa.selenium.JavascriptExecutor
    • getScreenshotAs

      public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
      Specified by:
      getScreenshotAs in interface org.openqa.selenium.TakesScreenshot
      Throws:
      org.openqa.selenium.WebDriverException