MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / newWindow

Method newWindow

javascript/selenium-webdriver/lib/webdriver.js:2514–2521  ·  view source on GitHub ↗

* Creates a new browser window and switches the focus for future * commands of this driver to the new window. * * @param {string} typeHint 'window' or 'tab'. The created window is not * guaranteed to be of the requested type; if the driver does not support * the requested type

(typeHint)

Source from the content-addressed store, hash-verified

2512 * when the driver has changed focus to the new window.
2513 */
2514 newWindow(typeHint) {
2515 const driver = this.driver_
2516 return this.driver_
2517 .execute(new command.Command(command.Name.SWITCH_TO_NEW_WINDOW).setParameter('type', typeHint))
2518 .then(function (response) {
2519 return driver.switchTo().window(response.handle)
2520 })
2521 }
2522
2523 /**
2524 * Changes focus to the active modal dialog, such as those opened by

Callers

nothing calls this directly

Calls 4

setParameterMethod · 0.80
executeMethod · 0.65
windowMethod · 0.65
switchToMethod · 0.65

Tested by

no test coverage detected