Set the size of the current window in CSS pixels.

Usage

                    .window.setSize(width, height, [callback])
                

Example

module.exports = {
  'set current window size': function (browser) {
     browser.window.setSize(1024, 768, function (result) {
       console.log('window resized successfully');
     });
  },

  'set current window size using ES6 async/await': async function (browser) {
     await browser.window.setSize(1024, 768);
  }
}

Parameters

Name Type description
width number

The new window width in CSS pixels.

height number

The new window height in CSS pixels.

callback
Optional
function

Optional callback function to be called when the command finishes.

See also