Module Webdriver_cohttp_eio.Capabilities

The requested capabilities when creating a new session.

See the WebDriver specification and the documentation of the chosen browser for more informations.

type t = json

A json describing the required capabilities for the session.

The capabilities are highly specific to the targetted browser. Here are some examples to get you started:

val chrome : t

The default chrome configuration:

  { "capabilities":
      { "firstMatch": [{ "browser_name": "chrome" } ] } }
val chrome_headless : t

Same as chrome, but runs in the background without a graphical window:

  { "capabilities":
      { "firstMatch":
          [{ "browser_name": "chrome",
             "goog:chromeOptions": { "args": [ "--headless"
                                             , "--disable-gpu"
                                             , "--no-sandbox"
                                             , "--disable-dev-shm-usage"
                                             , "--window-size=1920,1080"
                                             ] }
           }
          ]
      }
  }
val firefox : t

The default firefox configuration:

  { "capabilities":
      { "firstMatch": [{ "browser_name": "firefox" } ] } }
val firefox_headless : t

Same as firefox, but runs in the background without a graphical window:

  { "capabilities":
      { "firstMatch":
          [{ "browser_name": "firefox",
             "moz:firefoxOptions": { "args": ["-headless"] }
           }
          ]
      }
  }