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

Method createSession

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

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

Callers 1

webdriver_test.jsFile · 0.45

Calls 5

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

Tested by

no test coverage detected