Retrieves the current window position.

For clients which are compatible with the W3C Webdriver API, getWindowPosition is an alias of getWindowRect.

The getWindowRect command returns both dimensions and position of the window, using the windowRect protocol command.

Usage:

.getWindowPosition([callback])

Parameters:

Name Type description
callback function

Callback function to be called when the command finishes.

Example:

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

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

See also: