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

Function checkOptions

javascript/selenium-webdriver/index.js:769–779  ·  view source on GitHub ↗

* In the 3.x releases, the various browser option classes * (e.g. firefox.Options) had to be manually set as an option using the * Capabilities class: * * let ffo = new firefox.Options(); * // Configure firefox options... * * let caps = new Capabilities(); * caps.set('moz:fir

(caps, key, optionType, setMethod)

Source from the content-addressed store, hash-verified

767 * @throws {error.InvalidArgumentError}
768 */
769function checkOptions(caps, key, optionType, setMethod) {
770 let val = caps.get(key)
771 if (val instanceof optionType) {
772 throw new error.InvalidArgumentError(
773 'Options class extends Capabilities and should not be set as key ' +
774 `"${key}"; set browser-specific options with ` +
775 `Builder.${setMethod}(). For more information, see the ` +
776 'documentation attached to the function that threw this error',
777 )
778 }
779}
780
781// PUBLIC API
782

Callers 1

buildMethod · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected