Class Selenium::WebDriver::Window
In: lib/selenium/webdriver/common/window.rb
Parent: Object

@api beta This API may be changed or removed in a future release.

Methods

maximize   move_to   new   position   position=   resize_to   size   size=  

Public Class methods

@api private

Public Instance methods

Maximize the current window

Equivalent to position=, but accepts x and y arguments.

@example

  driver.manage.window.move_to(300, 400)

Get the position of the current window.

@return [Selenium::WebDriver::Point] The position.

Move the current window to the given position.

@param [Selenium::WebDriver::Point, x and y] point The new position.

Equivalent to size=, but accepts width and height arguments.

@example Maximize the window.

   max_width, max_height = driver.execute_script("return [window.screen.availWidth, window.screen.availHeight];")
   driver.manage.window.resize_to(max_width, max_height)

Get the size of the current window.

@return [Selenium::WebDriver::Dimension] The size.

Resize the current window to the given dimension.

@param [Selenium::WebDriver::Dimension, width and height] dimension The new size.

[Validate]