MCPcopy
hub / github.com/SeleniumHQ/selenium / createSession

Method createSession

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

* Creates a new WebDriver session. * * This function will always return a WebDriver instance. If there is an error * creating the session, such as the aforementioned SessionNotCreatedError, * the driver will have a rejected plain #getSession session promise. * This rejection wi

(executor, capabilities, onQuit = undefined)

Source from the content-addressed store, hash-verified

717 * @return {!WebDriver} The driver for the newly created session.
718 */
719 static createSession(executor, capabilities, onQuit = undefined) {
720 let cmd = new command.Command(command.Name.NEW_SESSION)
721
722 // For W3C remote ends.
723 cmd.setParameter('capabilities', {
724 firstMatch: [{}],
725 alwaysMatch: filterNonW3CCaps(capabilities),
726 })
727
728 let session = executeCommand(executor, cmd)
729 if (typeof onQuit === 'function') {
730 session = session.catch((err) => {
731 return Promise.resolve(onQuit.call(void 0)).then((_) => {
732 throw err
733 })
734 })
735 }
736 return new this(session, executor, onQuit)
737 }
738
739 /** @override */
740 async execute(command) {

Callers 1

webdriver_test.jsFile · 0.45

Calls 4

setParameterMethod · 0.95
filterNonW3CCapsFunction · 0.85
executeCommandFunction · 0.85
callMethod · 0.65

Tested by

no test coverage detected