Get the size of the current window in pixels.

Usage

                    .window.getSize([callback])
                

Example

module.exports = {
  'get current window size': function (browser) {
     browser.window.getSize(function (result) {
       console.log('Size of current window:', result.value.width, result.value.height);
     });
  },

  'get current window size using ES6 async/await': async function (browser) {
     const {width, height} = await browser.window.getSize();
     console.log('Size of current window:', width, height);
  }
}

Parameters

Name Type description
callback
Optional
function

Callback function which is called with the result value.

Returns

Type description
*

Size of the current window.

See also