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

Method build

javascript/selenium-webdriver/firefox.js:422–439  ·  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

420 * @return {!DriverService} A new driver service instance.
421 */
422 build() {
423 let port = this.options_.port || findFreePort()
424 let argsPromise = Promise.resolve(port).then((port) => {
425 // Start with the default --port argument.
426 let args = this.options_.args.concat(`--port=${port}`)
427 // If the "--connect-existing" flag is not set, add the websocket port.
428 if (!this.options_.args.some((arg) => arg === '--connect-existing')) {
429 return findFreePort().then((wsPort) => {
430 args.push(`--websocket-port=${wsPort}`)
431 return args
432 })
433 }
434 return args
435 })
436
437 let options = Object.assign({}, this.options_, { args: argsPromise, port })
438 return new remote.DriverService(this.exe_, options)
439 }
440}
441
442/**

Callers

nothing calls this directly

Calls 2

findFreePortFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected