Method: Appium::Driver#window_size

Defined in:
lib/appium_lib/driver.rb

#window_sizeSelenium::WebDriver::Dimension

Get the device window’s size.

Examples:


size = @driver.window_size
size.width #=> Integer
size.height #=> Integer

Returns:

  • (Selenium::WebDriver::Dimension)

Raises:


486
487
488
489
490
491
# File 'lib/appium_lib/driver.rb', line 486

def window_size
  # maybe exception is expected as no driver created
  raise NoDriverInstanceError if @driver.nil?

  @driver.window_size
end