Increases the window to the maximum available size without going full-screen.

Usage

Parameters

Name Type description
handleOrName
Optional
string

Only required when using non-W3C Webdriver protocols (such as JSONWire). windowHandle URL parameter; if it is "current", the currently active window will be maximized.

callback
Optional
function

Optional callback function to be called when the command finishes.

Example

module.exports = {
 'demo Test with W3C Webdriver clients': function(browser) {
    // W3C Webdriver API doesn't require the window handle parameter anymore
    browser.windowMaximize(function(result) {
      console.log(result);
    });
  },

  'ES6 async demo Test': async function(browser) {
    const result = await browser.windowMaximize();
    console.log('result value is:', result.value);
  },

  'when using JSONWire (deprecated) clients': function(browser) {
     browser.windowMaximize('current', function(result) {
       console.log(result);
     });
  }
}

W3C WebDriver spec