Skip to content

Selenium quickstart

A MaxoPerf fleet speaks the W3C WebDriver protocol, so any Selenium client connects with a one-URL swap: replace your grid’s command_executor / server URL with the fleet’s WebDriver endpoint. Choose the browser with the standard browserName capability (ChromeOptions, FirefoxOptions, EdgeOptions).

  • A running fleet with at least one chrome, firefox, or edge browser. Create one from the console, an AI agent, or the REST API below.
  • The fleet’s connection token (mpft_…) or an account API key (mpak_…).

For the protocol-agnostic version of this page (endpoint shapes, credential positions, and how a fleet’s protocols relate), see Connect a client.

Selenium clients pass credentials as basic auth in the URL — the fleet id is the username and the token is the password:

https://<fleetId>:<token>@app.maxoperf.com/browser-fleets/<fleetId>/wd/hub

Any mpak_… account key with access to the fleet works in the password position too.

# pip install selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
driver = webdriver.Remote(
command_executor="https://flt-a1b2c3d4e5:mpft_example_token@app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/wd/hub",
options=ChromeOptions(), # or FirefoxOptions() / EdgeOptions()
)
driver.get("https://example.com")
print(driver.title)
driver.quit()

Replace flt-a1b2c3d4e5 with your fleet id and mpft_example_token with your token.

The browserName capability decides which fleet browser you get. Swap the options object per language:

  • chromeChromeOptions (Python/Java) or .forBrowser('chrome') (JS)
  • firefoxFirefoxOptions or .forBrowser('firefox')
  • edgeEdgeOptions or .forBrowser('MicrosoftEdge')

If you’d rather script fleet creation than click through the console, POST /v1/fleets with a JWT or an mpak_… API key. Request browsers by count and location, and optionally set how many browsers pack onto each runner, a lifetime, and an idle timeout:

Terminal window
curl -X POST https://app.maxoperf.com/v1/fleets \
-H "Authorization: Bearer mpak_example_key" \
-H "X-Account-Id: acn-1234567890" \
-H "Content-Type: application/json" \
-d '{
"name": "nightly-eu-grid",
"browsers": [
{ "browser": "chrome", "count": 5, "location": "aws:us-east-1" },
{ "browser": "firefox", "count": 3, "location": "gcp:europe-west1" },
{ "browser": "edge", "count": 2, "location": "aws:us-east-1" }
],
"browsersPerRunner": 5,
"ttlMinutes": 120,
"idleTimeoutMinutes": 15
}'

The 201 response carries the fleet id, the run it created, every endpoint, the connection token (this is the one time it is returned inline — retrieve it later with GET /v1/fleets/<fleetId>/token), and the supported Playwright minors:

{
"fleetId": "flt-a1b2c3d4e5",
"runId": "run-9f8e7d6c5b",
"status": "allocating",
"endpoints": {
"webdriver": "https://app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/wd/hub",
"playwright": {
"chromium": "wss://app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/playwright/chromium",
"firefox": "wss://app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/playwright/firefox",
"msedge": "wss://app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/playwright/msedge"
},
"cdp": "wss://app.maxoperf.com/browser-fleets/flt-a1b2c3d4e5/cdp"
},
"token": "mpft_example_token",
"expiresAt": "2026-07-19T14:00:00Z",
"supportedPlaywrightVersions": ["1.59", "1.58", "1.57", "1.56"]
}

browsersPerRunner is the fleet analogue of “virtual users per runner” on test create: 1 gives each session a full-screen solo video; higher values pack more browsers per runner with tiled video. It defaults to your plan’s browser policy and is clamped to your tier’s min/max. See Billing & limits.

  • 401 Unauthorized — bad or missing credentials, or the fleet isn’t yours. In Java, see the preemptive basic-auth note above.
  • invalid session id — the session already ended (idle timeout) or never existed. Start a new session.
  • session not created after a pause — every browser was busy; the gateway queues new-session requests briefly and returns this W3C error if no slot frees up. Add browsers or lower concurrency.
  • 410 Gone — the fleet has ended. Create a new one.