MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / newWindow

Method newWindow

javascript/selenium-webdriver/lib/webdriver.js:2477–2484  ·  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

2475 * when the driver has changed focus to the new window.
2476 */
2477 newWindow(typeHint) {
2478 const driver = this.driver_
2479 return this.driver_
2480 .execute(new command.Command(command.Name.SWITCH_TO_NEW_WINDOW).setParameter('type', typeHint))
2481 .then(function (response) {
2482 return driver.switchTo().window(response.handle)
2483 })
2484 }
2485
2486 /**
2487 * 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