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

Method createSession

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

727 * @return {!WebDriver} The driver for the newly created session.
728 */
729 static createSession(executor, capabilities, onQuit = undefined) {
730 let cmd = new command.Command(command.Name.NEW_SESSION)
731
732 // For W3C remote ends.
733 cmd.setParameter('capabilities', {
734 firstMatch: [{}],
735 alwaysMatch: filterNonW3CCaps(capabilities),
736 })
737
738 let session = executeCommand(executor, cmd)
739 if (typeof onQuit === 'function') {
740 session = session.catch((err) => {
741 return Promise.resolve(onQuit.call(void 0)).then((_) => {
742 throw err
743 })
744 })
745 }
746 return new this(session, executor, onQuit)
747 }
748
749 /** @override */
750 async execute(command) {

Callers 1

webdriver_test.jsFile · 0.45

Calls 5

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

Tested by

no test coverage detected