Change or get the window rect. This is defined as a dictionary of the screenX, screenY, outerWidth and outerHeight attributes of the window.

Its JSON representation is the following:

  • x - window's screenX attribute;
  • y - window's screenY attribute;
  • width - outerWidth attribute;
  • height - outerHeight attribute.

All attributes are in in CSS pixels. To change the window react, you can either specify width and height, x and y or all properties together.

Usage

Example

module.exports = {
  'demo test .getWindowRect()': function(browser) {
     // Retrieve the attributes
     browser.getWindowRect(function(value) {
       console.log(value);
     });
  },

  'getWindowRect ES6 demo test': async function(browser) {
     const resultValue = await browser.getWindowRect();
     console.log('result value', resultValue);
  }
}

Parameters

Name Type description
callback function

Callback function to be called when the command finishes.

See also

W3C WebDriver spec