Get the coordinates of the top left corner of the current window.

Usage

                    .window.getPosition([callback])
                

Example

module.exports = {
  'get current window position': function (browser) {
     browser.window.getPosition(function (result) {
       console.log('Position of current window:', result.value.x, result.value.y);
     });
  },

  'get current window position using ES6 async/await': async function (browser) {
     const {x, y} = await browser.window.getPosition();
     console.log('Position of current window:', x, y);
  }
}

Parameters

Name Type description
callback
Optional
function

Callback function which is called with the result value.

Returns

Type description
*

Coordinates representing the position of the current window.

See also