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

Method createSession

javascript/selenium-webdriver/chromium.js:618–655  ·  view source on GitHub ↗

* Creates a new session with the WebDriver server. * * @param {(Capabilities|Options)=} caps The configuration options. * @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either * a DriverService to use for the remote end, or a preconfigured executor * for a

(caps, opt_serviceExecutor, vendorPrefix = '', vendorCapabilityKey = '')

Source from the content-addressed store, hash-verified

616 * @return {!Driver} A new driver instance.
617 */
618 static createSession(caps, opt_serviceExecutor, vendorPrefix = '', vendorCapabilityKey = '') {
619 let executor
620 let onQuit
621 if (opt_serviceExecutor instanceof http.Executor) {
622 executor = opt_serviceExecutor
623 configureExecutor(executor, vendorPrefix)
624 } else {
625 let service = opt_serviceExecutor || this.getDefaultService()
626 if (!service.getExecutable()) {
627 const { driverPath, browserPath } = getBinaryPaths(caps)
628 service.setExecutable(driverPath)
629 if (browserPath) {
630 const vendorOptions = caps.get(vendorCapabilityKey)
631 if (vendorOptions) {
632 vendorOptions['binary'] = browserPath
633 caps.set(vendorCapabilityKey, vendorOptions)
634 } else {
635 caps.set(vendorCapabilityKey, { binary: browserPath })
636 }
637 caps.delete(Capability.BROWSER_VERSION)
638 }
639 }
640 onQuit = () => service.kill()
641 executor = createExecutor(service.start(), vendorPrefix)
642 }
643
644 // W3C spec requires noProxy value to be an array of strings, but Chromium
645 // expects a single host as a string.
646 let proxy = caps.get(Capability.PROXY)
647 if (proxy && Array.isArray(proxy.noProxy)) {
648 proxy.noProxy = proxy.noProxy[0]
649 if (!proxy.noProxy) {
650 proxy.noProxy = undefined
651 }
652 }
653
654 return /** @type {!Driver} */ (super.createSession(executor, caps, onQuit))
655 }
656
657 /**
658 * This function is a no-op as file detectors are not supported by this

Callers

nothing calls this directly

Calls 11

getDefaultServiceMethod · 0.95
getBinaryPathsFunction · 0.85
configureExecutorFunction · 0.70
createExecutorFunction · 0.70
getMethod · 0.65
setMethod · 0.65
startMethod · 0.65
getExecutableMethod · 0.45
setExecutableMethod · 0.45
deleteMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected