TestKase
TestKase
|Docs
Automate

Selenium

Run any official Selenium binding against the TestKase W3C WebDriver endpoint — capabilities, authentication, per-test hooks, and supported commands.

Selenium (W3C WebDriver)

The Selenium endpoint is a standard W3C WebDriver Classic grid at https://hub.testkase.com/wd/hub. Every official Selenium binding — Java, Python, JavaScript, Ruby, C# — speaks it natively, with no TestKase SDK required.

TestKase is a transport, not a translator: your Selenium library issues every command (click, type, navigate, screenshot) and the Hub forwards it to the in-VM driver — chromedriver, msedgedriver, geckodriver, or safaridriver.

The endpoint

https://<email>:<accessKey>@hub.testkase.com/wd/hub

Point your RemoteWebDriver / Builder at this URL and pass W3C capabilities as usual.

Quick start

JavaScript (selenium-webdriver)

const { Builder, By } = require("selenium-webdriver");

const hub = "https://your-email%40company.com:xyz_your_access_key@hub.testkase.com/wd/hub";

const driver = await new Builder()
  .usingServer(hub)
  .withCapabilities({
    browserName: "chrome",
    browserVersion: "latest",
    platformName: "macOS 15",
    "testkase:options": { build: "smoke-1", name: "my-test" },
  })
  .build();

await driver.get("https://example.com");
await driver.quit();

Python (selenium)

from selenium import webdriver
from selenium.webdriver.common.options import ArgOptions

options = ArgOptions()
options.browser_name = "chrome"
options.browser_version = "latest"
options.platform_name = "macOS 15"
options.set_capability("testkase:options", {"build": "smoke-1", "name": "my-test"})

hub = "https://your-email%40company.com:xyz_your_access_key@hub.testkase.com/wd/hub"
driver = webdriver.Remote(command_executor=hub, options=options)
driver.get("https://example.com")
driver.quit()

Java (selenium-java)

MutableCapabilities caps = new MutableCapabilities();
caps.setCapability("browserName", "chrome");
caps.setCapability("browserVersion", "latest");
caps.setCapability("platformName", "macOS 15");

HashMap<String, Object> tk = new HashMap<>();
tk.put("build", "smoke-1");
tk.put("name", "my-test");
caps.setCapability("testkase:options", tk);

URL hub = new URL("https://your-email%40company.com:xyz_your_access_key@hub.testkase.com/wd/hub");
RemoteWebDriver driver = new RemoteWebDriver(hub, caps);
driver.get("https://example.com");
driver.quit();

Authentication

Authentication is URL basic-auth in the userinfo portion of the Hub URL:

https://<email>:<accessKey>@hub.testkase.com/wd/hub

URL-encode the @ in your email as %40. Most bindings expect valid URL syntax and will silently swallow a literal @, breaking the credentials.

If your CI tool won't let you embed credentials in the URL, pass them inside capabilities instead — testkase:options.username (your login email) and testkase:options.accessKey.

Capabilities

Standard W3C capabilities select the browser and platform:

CapabilityExampleNotes
browserNamechrome, edge / MicrosoftEdge, firefox, safariThe browser to run
browserVersionlatest, latest-1, latest-N, 142Defaults to latest when omitted
platformNamemacOS 15, macOS 26macOS Sequoia / macOS Tahoe also accepted

See Browsers for the full brand/version/platform matrix.

testkase:options

Vendor-namespaced capabilities live under the testkase:options key. All are optional.

KeyTypeEffect
buildstringGroups multiple sessions under one named build. Use a CI run ID or commit SHA.
namestringPer-session label shown in the session list and recording filename.
usernamestringAlternative to URL basic auth (your TestKase login email).
accessKeystringAlternative to URL basic auth (your TestKase access key).
tagsstring[]Free-form labels for filtering the session list.
recordingboolean (default true)Capture session video. Set false to opt out.
consoleboolean (default true)Capture browser console. Chrome/Edge, plus Firefox 113+.
networkboolean (default true)Capture HTTP requests. Chrome/Edge, plus Firefox 129+.
driverboolean (default true)Capture driver diagnostic output.

Per-test metadata (LambdaTest-compatible hooks)

Selenium has no built-in concept of a "test" — driver is just a connection. To group commands into named tests on the dashboard, emit these hooks from your test code:

// Mark the beginning of a logical test
driver.executeScript("testkase-name=Search renders results");

// Mark the outcome (passed | failed)
driver.executeScript("testkase-status=passed");

These mirror LambdaTest's lambda-name / lambda-status pattern verbatim, so existing suites migrate by swapping the prefix. The Hub intercepts the hook server-side — the browser never runs it. Between a testkase-name= and its matching testkase-status=, the agent also slices a per-test recording.

For a failure reason or arbitrary log lines, use the JSON form:

driver.executeScript(
  "return null",
  `testkase_action: ${JSON.stringify({
    action: "setTestStatus",
    arguments: { status: "failed", remark: err.message },
  })}`,
);

Supported commands

Every command in the W3C WebDriver spec is forwarded as-is to the in-VM driver — findElement, executeScript, actions, frame switching, cookie management, file uploads, and so on. Anything your local driver supports works here.

Sessions end automatically on three rules: a 60-minute wall-clock cap, 10 minutes of customer idle (no WebDriver command from your code), and a service-unreachable timeout. A driver.sleep() sends no command, so send a cheap call like getCurrentUrl() to reset the idle window during long pauses. Full table in Reference.

Next steps