Interface WebDriver.Window

All Known Implementing Classes:
RemoteWebDriver.RemoteWebDriverOptions.RemoteWindow
Enclosing interface:
WebDriver

@Beta public static interface WebDriver.Window
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Fullscreen the current window if it is not already fullscreen
    Get the position of the current window, relative to the upper left corner of the screen.
    Get the size of the current window.
    void
    Maximizes the current window if it is not already maximized
    void
    Minimizes the current window if it is not already minimized
    void
    setPosition(Point targetPosition)
    Set the position of the current window.
    void
    setSize(Dimension targetSize)
    Set the size of the current window.
  • Method Details

    • getSize

      Dimension getSize()
      Get the size of the current window. This will return the outer window dimension, not just the view port.

      See W3C WebDriver specification for more details.

      Returns:
      The current window size.
    • setSize

      void setSize(Dimension targetSize)
      Set the size of the current window. This will change the outer window dimension, not just the view port, synonymous to window.resizeTo() in JS.

      See W3C WebDriver specification for more details.

      Parameters:
      targetSize - The target size.
    • getPosition

      Point getPosition()
      Get the position of the current window, relative to the upper left corner of the screen.

      See W3C WebDriver specification for more details.

      Returns:
      The current window position.
    • setPosition

      void setPosition(Point targetPosition)
      Set the position of the current window. This is relative to the upper left corner of the screen, synonymous to window.moveTo() in JS.

      See W3C WebDriver specification for more details.

      Parameters:
      targetPosition - The target position of the window.
    • maximize

      void maximize()
      Maximizes the current window if it is not already maximized

      See W3C WebDriver specification for more details.

    • minimize

      void minimize()
      Minimizes the current window if it is not already minimized

      See W3C WebDriver specification for more details.

    • fullscreen

      void fullscreen()
      Fullscreen the current window if it is not already fullscreen

      See W3C WebDriver specification for more details.