Method: Selenium::WebDriver::Window#rect=

Defined in:
lib/selenium/webdriver/common/window.rb

#rect=(rectangle) ⇒ Object

Sets the current window rect to the given point and position.

Parameters:



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/selenium/webdriver/common/window.rb', line 87

def rect=(rectangle)
  unless %w[x y width height].all? { |val| rectangle.respond_to? val }
    raise ArgumentError, "expected #{rectangle.inspect}:#{rectangle.class} " \
                         'to respond to #x, #y, #width, and #height'
  end

  @bridge.set_window_rect(x: rectangle.x,
                          y: rectangle.y,
                          width: rectangle.width,
                          height: rectangle.height)
end