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

Method build

javascript/selenium-webdriver/firefox.js:516–533  ·  view source on GitHub ↗

* Overrides the parent build() method to add the websocket port argument * for Firefox when not connecting to an existing instance. * * @return {!DriverService} A new driver service instance.

()

Source from the content-addressed store, hash-verified

514 * @return {!DriverService} A new driver service instance.
515 */
516 build() {
517 let port = this.options_.port || findFreePort()
518 let argsPromise = Promise.resolve(port).then((port) => {
519 // Start with the default --port argument.
520 let args = this.options_.args.concat(`--port=${port}`)
521 // If the "--connect-existing" flag is not set, add the websocket port.
522 if (!this.options_.args.some((arg) => arg === '--connect-existing')) {
523 return findFreePort().then((wsPort) => {
524 args.push(`--websocket-port=${wsPort}`)
525 return args
526 })
527 }
528 return args
529 })
530
531 let options = Object.assign({}, this.options_, { args: argsPromise, port })
532 return new remote.DriverService(this.exe_, options)
533 }
534}
535
536/**

Callers 1

createSessionMethod · 0.45

Calls 2

findFreePortFunction · 0.85
concatMethod · 0.45

Tested by

no test coverage detected