w3c-webdriver
  • Introduction
  • Capabilities
  • Sessions
  • Timeouts
  • Navigation
  • Contexts
  • Elements
  • Document
  • Cookies
  • Actions
  • User prompts
  • Screen capture
  • Examples
    • Cucumber Functional Tests
  • Resources
    • GitHub
    • WebDriver spec
    • MDN docs
Powered by GitBook
On this page
  • Capabilities
  • BrowserCapability
  • ChromeOptions
  • FirefoxOptions
  • InternetExplorerOptions
  • BrowserStackOptions

Was this helpful?

Capabilities

PreviousIntroductionNextSessions

Last updated 3 years ago

Was this helpful?

Capabilities

Before we can send any command to the browser we drive we need to create a session. This should be always the first step of interaction using the protocol. To create a new session we need to provide some requirements like browserName, browserVersion, platformName. These requirements are called . This is especially important when we interact not directly with a single browser but with a grid of browsers. Using alwaysMatch property we can provide some strict requirements. If the WebDriver sever can't provide the required features the session creation will fail. Using firstMatch property we can provide a list of requirements. During session creation the server will pick the first capability it's able to match. firstMatch can of course be combined with alwaysMatch to narrow down the selection.

PROPERTIES

  • alwaysMatch?:

  • firstMatch?: []

EXAMPLES

const capabilities = {
  alwaysMatch: {
    browserName: 'firefox',
    browserVersion: '60'
  }
}
const capabilities = {
  firstMatch: [
    { browserName: 'chrome' },
    { browserName: 'firefox' }
  ]
}

SEE ALSO

BrowserCapability

PROPERTIES

  • browserName?: string

  • browserVersion?: string

  • platformName?: string

  • acceptInsecureCerts?: boolean

  • pageLoadStrategy: 'none' | 'eager' | 'normal'

  • unhandledPromptBehavior: 'dismiss' | 'accept' | 'dismiss and notify' | 'accept and notify' | 'ignore'

ChromeOptions

PROPERTIES

  • w3c?: boolean

  • binary?: string

  • args?: string[]

FirefoxOptions

PROPERTIES

  • binary?: string

  • args?: string[]

  • profile?: string

  • log?: object

    • level?: string

  • prefs?: object

SEE ALSO

InternetExplorerOptions

PROPERTIES

  • ignoreProtectedModeSettings: boolean

  • ignoreZoomSetting: boolean

  • ie.ensureCleanSession: boolean

BrowserStackOptions

PROPERTIES

  • os?: string

  • osVersion?: string

  • sessionName?: string

  • buildName?: string

  • projectName?: string

  • debug?: boolean

  • networkLogs?: boolean

  • local?: boolean

  • seleniumVersion?: string

  • safari?: object

    • enablePopups?: boolean

    • useSimulator?: boolean

    • allowAllCookies?: boolean

    • driver?: string

goog:chromeOptions?:

moz:firefoxOptions?:

se:ieOptions?:

bstack:options?:

MDN web docs
MDN web docs
WebDriver
Capabilities
BrowserCapability
BrowserCapability
ChromeOptions
FirefoxOptions
InternetExplorerOptions
BrowserStackOptions