TestKase
TestKase
|Docs
AutomateBrowserPlaywright

Capabilities

What capabilities are on Playwright, the few you need to start, and the rest of them one line at a time.

A capability is a note you attach to your test saying what machine you want and what you want kept. Playwright has no capability concept of its own, so they travel in the connect address — one JSON object, URL-encoded onto the end of it.

const capabilities = {
  browserName: "chrome",
  "testkase:options": {
    accessKey: "xyz_your_access_key_here",
    platformName: "windows 11",
  },
};

const browser = await chromium.connect(
  `wss://hub.testkase.com/playwright?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`,
);
Always set platformName. Leave it out and Chrome, Edge and Firefox fall back to linux, which none of our machines run — so the session is refused rather than defaulted. Only Safari has a working fallback (newest macOS).

Your access key

The one thing every session needs. Copy it from the Access key page, and put it in testkase:options.accessKey.

There is no username-and-password form here — the address is a WebSocket URL, not an HTTP one, so the access key is the only credential.

Don't want to write this by hand? The capability generator shows every browser, version and platform we have running right now, and writes the whole snippet in your language.

Choosing the machine

browserName and browserVersion sit at the top level. platformName can go either place — inside testkase:options wins if you set both.

CapabilityWhat it doesExample
browserNameWhich browser. Leave it out and you get Chrome.{"browserName": "firefox"}
browserVersionWhich version of it. Leave it out for the newest.{"browserVersion": "latest-1"}
platformNameWhich operating system. Set this.{"testkase:options": {"platformName": "macOS 26"}}

The four you will actually use

CapabilityWhat it doesExample
nameWhat this session is called in your dashboard.{"testkase:options": {"name": "Checkout — guest"}}
recordingRecords a video of the session. You get no video unless you ask for it.{"testkase:options": {"recording": true}}
runIdGroups sessions together. Give every worker in one CI job the same value and they appear as a single run instead of twenty.{"testkase:options": {"runId": "ci-8891"}}
buildA label, like a version number, shown next to the session. Unlike runId, it does not group anything.{"testkase:options": {"build": "nightly-42"}}

The rest

CapabilityWhat it doesExample
tagsYour own labels on a session, so you can find it later.{"testkase:options": {"tags": ["smoke"]}}
consoleKeeps whatever your site printed to the browser console. Off unless you ask.{"testkase:options": {"console": true}}
networkKeeps a log of every network request the page made. Off unless you ask.{"testkase:options": {"network": true}}
driverKeeps the browser's own launch log. Off unless you ask.{"testkase:options": {"driver": true}}
headlessRuns with no visible window. Playwright only — and not with recording, because there is nothing to film.{"testkase:options": {"headless": true}}
resolutionHow big the browser window is. On Playwright, also set viewport: null so the page fills it.{"testkase:options": {"resolution": "1440x900"}}
playwrightVersionWhich Playwright your client is. We read it from your connection automatically; set it only if your CI strips that header.{"testkase:options": {"playwrightVersion": "1.55"}}
idleTimeoutHow long your test may go quiet before we assume it died and stop it. Five minutes by default, up to twenty.{"testkase:options": {"idleTimeout": 900}}
maxQueueWaitSecondsIf every matching machine is busy, how long to wait in line. Five minutes by default, up to nine. Waiting is not billed.{"testkase:options": {"maxQueueWaitSeconds": 600}}
tunnelTests a site running on your own computer. See Local testing.{"testkase:options": {"tunnel": "office"}}
The three capture options are off here and on with Selenium. Console, network and driver logs default to on for a Selenium session and off for a Playwright one. Move tests across and they quietly stop being kept unless you ask.

When a connection is refused

Playwright cannot show you an HTTP status, so a refusal arrives as a WebSocket close code:

CodeMeans
4400A capability we could not read — usually a typo, or a platform we do not run
4401The access key is missing or wrong
4404Nothing we have matches what you asked for. The message lists what is available
4429You are already using every session your plan allows
4426You asked for a tunnel and none is connected

Questions

▶Which browser names can I write?

chrome, edge, firefox and safari. chromium also means Chrome, webkit means Safari, and MicrosoftEdge means Edge — so whatever your tests already say will almost certainly work. Capital letters never matter.

Firefox and Safari run Playwright's own patched builds, which is why you may see them called pw-firefox and pw-webkit elsewhere. You do not have to write those names.

▶Which platforms can I write?

Name the operating system with its major version, like macOS 26 or windows 11. A bare macOS means the newest macOS we run, and a bare windows means our default Windows.

Safari runs on macOS only. Chrome, Edge and Firefox run on every platform. The capability generator lists the platforms available right now.

▶Why does my session get refused when I leave platformName out?

Because the fallback for Chrome, Edge and Firefox is linux, and we have no Linux browsers. You get a 4404 listing what is available.

Safari is the exception: its fallback is the newest macOS, because Safari cannot run anywhere else.

▶Can I run headless?

Yes — Playwright is the only one that can, because we start the browser for you. Not together with recording though: a headless browser has no screen to film, and asking for both is refused.

▶What ends a session besides my own code?

Two clocks: two hours in total, and five minutes of going quiet. You can raise the quiet one with idleTimeout.