appium
Version:
Automation for Apps.
83 lines (76 loc) • 2.54 kB
YAML
name: Get Window Size
short_description: Get the size of the specified window (Web context only)
example_usage:
java:
|
Dimension windowSize = driver.manage().window().getSize();
python:
|
handle_one_size = self.driver.get_window_size()
handle_two_size = self.driver.get_window_size("handleName")
javascript_wd:
|
let handleOneSize = await driver.getWindowSize();
let handleTwoSize = await driver.getWindowSize("handleName");
javascript_wdio:
|
let handleOneSize = driver.windowHandleSize();
let handleTwoSize = driver.windowHandleSize("handleName");
ruby:
|
@driver.window_size()
@driver.window_size("handleName")
php:
|
// TODO PHP sample
csharp:
|
// TODO C# sample
client_docs:
java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebDriver.Window.html#getSize--"
python: "http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webdriver.WebDriver.get_window_size"
javascript_wdio: "http://webdriver.io/api/protocol/windowHandleSize.html"
javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L546"
ruby: "http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Remote/W3C/Bridge:window_size"
php: "https://github.com/appium/php-client/" # TODO PHP documentation link
csharp: "https://github.com/appium/appium-dotnet-driver/" # TODO Dotnet documentation link
# Driver support by platform
driver_support:
ios:
xcuitest: false
uiautomation: false
android:
uiautomator2: false
uiautomator: false
mac:
mac: false
windows:
windows: false
client_support:
java: true
python: true
ruby: true
php: true
csharp: true
javascript_wd: true
javascript_wdio: true
# Information about the HTTP endpoints
endpoint:
url: /wd/hub/session/:session_id/window/:window_handle/size
method: GET
url_parameters:
- name: session_id
description: ID of the session to route the command to
- name: window_handle
description: Handle of the window to get size of. If 'current' it will get size of current window.
response:
- name: width
type: number
description: The width of the window
- name: height
type: number
description: The height of the window
# Links to specifications. Should link to at least one specification
specifications:
jsonwp: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandlesize