Class webdriver.WebDriver.Window
Defined in: webdriver.js.
Constructor Attributes | Constructor Name and Description |
---|---|
webdriver.WebDriver.Window(driver)
An interface for managing the current window.
|
Method Attributes | Method Name and Description |
---|---|
Retrieves the window's current position, relative to the top left corner of
the screen.
|
|
getSize()
Retrieves the window's current size.
|
|
maximize()
Maximizes the current window.
|
|
setPosition(x, y)
Repositions the current window.
|
|
setSize(width, height)
Resizes the current window.
|
Class Detail
webdriver.WebDriver.Window(driver)
An interface for managing the current window.
- Parameters:
- {!webdriver.WebDriver} driver
- The parent driver.
Method Detail
{!webdriver.promise.Promise}
getPosition()
Retrieves the window's current position, relative to the top left corner of
the screen.
- Returns:
- {!webdriver.promise.Promise} A promise that will be resolved with the window's position in the form of a {x:number, y:number} object literal.
{!webdriver.promise.Promise}
getSize()
Retrieves the window's current size.
- Returns:
- {!webdriver.promise.Promise} A promise that will be resolved with the window's size in the form of a {width:number, height:number} object literal.
{!webdriver.promise.Promise}
maximize()
Maximizes the current window.
- Returns:
- {!webdriver.promise.Promise} A promise that will be resolved when the command has completed.
{!webdriver.promise.Promise}
setPosition(x, y)
Repositions the current window.
- Parameters:
- {number} x
- The desired horizontal position, relative to the left side of the screen.
- {number} y
- The desired vertical position, relative to the top of the of the screen.
- Returns:
- {!webdriver.promise.Promise} A promise that will be resolved when the command has completed.
{!webdriver.promise.Promise}
setSize(width, height)
Resizes the current window.
- Parameters:
- {number} width
- The desired window width.
- {number} height
- The desired window height.
- Returns:
- {!webdriver.promise.Promise} A promise that will be resolved when the command has completed.