Wallaby.Selenium (wallaby v0.27.0) View Source

The Selenium driver uses Selenium Server to power many types of browsers (Chrome, Firefox, Edge, etc).

Usage

Start a Wallaby Session using this driver with the following command:

{:ok, session} = Wallaby.start_session()

Configuration

Capabilities

These capabilities will override the default capabilities.

config :wallaby,
  selenium: [
    capabilities: %{
      # something
    }
  ]

Default Capabilities

By default, Selenium will use the following capabilities

You can read more about capabilities in the JSON Wire Protocol documentation.

%{
  javascriptEnabled: true,
  browserName: "firefox",
  "moz:firefoxOptions": %{
    args: ["-headless"]
  }
}

Notes

  • Requires selenium-server-standalone to be running on port 4444. Wallaby does not manage the start/stop of the Selenium server.
  • Requires GeckoDriver to be installed in your path when using Firefox. Firefox is used by default.

Link to this section Summary

Types

Options to pass to Wallaby.start_session/1

Functions

Returns a specification to start this module under a supervisor.

Link to this section Types

Specs

start_session_opts() :: {:remote_url, String.t()} | {:capabilities, map()}

Options to pass to Wallaby.start_session/1

Wallaby.start_session(
  remote_url: "http://selenium_url",
  capabilities: %{browserName: "firefox"}
)

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.