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))}`,
);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.
Choosing the machine
browserName and browserVersion sit at the top level. platformName can go either place — inside testkase:options wins if you set both.
| Capability | What it does | Example |
|---|---|---|
browserName | Which browser. Leave it out and you get Chrome. | {"browserName": "firefox"} |
browserVersion | Which version of it. Leave it out for the newest. | {"browserVersion": "latest-1"} |
platformName | Which operating system. Set this. | {"testkase:options": {"platformName": "macOS 26"}} |
The four you will actually use
| Capability | What it does | Example |
|---|---|---|
name | What this session is called in your dashboard. | {"testkase:options": {"name": "Checkout — guest"}} |
recording | Records a video of the session. You get no video unless you ask for it. | {"testkase:options": {"recording": true}} |
runId | Groups 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"}} |
build | A label, like a version number, shown next to the session. Unlike runId, it does not group anything. | {"testkase:options": {"build": "nightly-42"}} |
The rest
| Capability | What it does | Example |
|---|---|---|
tags | Your own labels on a session, so you can find it later. | {"testkase:options": {"tags": ["smoke"]}} |
console | Keeps whatever your site printed to the browser console. Off unless you ask. | {"testkase:options": {"console": true}} |
network | Keeps a log of every network request the page made. Off unless you ask. | {"testkase:options": {"network": true}} |
driver | Keeps the browser's own launch log. Off unless you ask. | {"testkase:options": {"driver": true}} |
headless | Runs with no visible window. Playwright only — and not with recording, because there is nothing to film. | {"testkase:options": {"headless": true}} |
resolution | How big the browser window is. On Playwright, also set viewport: null so the page fills it. | {"testkase:options": {"resolution": "1440x900"}} |
playwrightVersion | Which 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"}} |
idleTimeout | How 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}} |
maxQueueWaitSeconds | If 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}} |
tunnel | Tests a site running on your own computer. See Local testing. | {"testkase:options": {"tunnel": "office"}} |
When a connection is refused
Playwright cannot show you an HTTP status, so a refusal arrives as a WebSocket close code:
| Code | Means |
|---|---|
4400 | A capability we could not read — usually a typo, or a platform we do not run |
4401 | The access key is missing or wrong |
4404 | Nothing we have matches what you asked for. The message lists what is available |
4429 | You are already using every session your plan allows |
4426 | You 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.
