skip to content

[ compare · web testing frameworks ]

e2e vs selenium

Selenium automates browsers through WebDriver. e2e combines a test runner, retrying assertions, and agent goals for web and native mobile apps.

[ at a glance ]

what each tool is.

  • made by, license

    [ e2e ]

    e2e, Apache-2.0

    [ selenium ]

    the Selenium project under the Software Freedom Conservancy; Apache-2.0

  • browsers

    [ e2e ]

    Chromium, Firefox, WebKit (Safari's engine) through Playwright; iOS and Android apps through agent-device

    [ selenium ]

    Chrome, Edge, Firefox, Safari through each vendor's driver; mobile browsers and native apps through Appium

  • languages

    [ e2e ]

    TypeScript, JavaScript

    [ selenium ]

    Java, Python, C#, Ruby, JavaScript

  • what it includes

    [ e2e ]

    runner, locators, assertions, agent steps, reporters, trace pages, video, replay cache

    [ selenium ]

    WebDriver, grid, ide, Selenium manager, bidi; assertions and reports come from your test framework

  • waits

    [ e2e ]

    actions wait for their target, assertions retry until they pass or time out, and agent.waitFor waits for a condition in plain language

    [ selenium ]

    implicit and explicit waits you write, with WebDriverWait and expected conditions

  • when ai is used

    [ e2e ]

    at run time, when a step needs it. verified goals replay without model calls.

    [ selenium ]

    nowhere

  • parallel runs

    [ e2e ]

    workers and shards; web({ connect }) to a remote Chromium; browser providers such as Kernel, smol, Lightpanda, TestMu AI

    [ selenium ]

    Selenium Grid and the device clouds that speak WebDriver

[ the same test ]

the same test,written both ways.

selenium
driver.get("http://localhost:3000/login");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(visibilityOfElementLocated(By.id("username"))).sendKeys("admin@example.test");
driver.findElement(By.id("password")).sendKeys(System.getenv("ADMIN_PASSWORD"));
driver.findElement(By.xpath("//button[contains(., 'Sign in')]")).click();
wait.until(urlContains("/dashboard"));
assertEquals("Welcome back, admin!",
    driver.findElement(By.cssSelector(".greeting")).getText());
e2e
import { test } from '@e2e-dev/web';
import { expect, credentials } from 'e2e';

test('signs in', async ({ app, agent, browser }) => {
  const admin = credentials.user('admin');
  await app.open('/login');
  await agent.act('sign in as {username}', { params: { username: admin.username, password: admin.password } });
  await expect(browser).toHaveURL('/dashboard');
  await agent.assert('the page greets admin by name');
});

sign-in becomes one goal with a credential the model never sees. the url check stays exact; the agent checks the greeting.

[ differences ]

the five main differences.

  • what you get in the package

    Selenium WebDriver automates browsers. you choose the test framework, assertions, reporter, and retry strategy.

    e2e includes those pieces, plus agent steps, fixtures, markdown traces, and videos. reports include json and JUnit for ci.

  • waits

    Selenium offers implicit waits and explicit waits such as WebDriverWait. its docs warn against mixing them.

    e2e locator actions wait for their targets, and assertions retry until they pass or time out. use agent.waitFor for a condition in plain language.

  • finding elements

    Selenium finds elements by id, name, css, xpath, and link text. findElement returns the first match.

    e2e queries by role, label, text, and test id. string queries match the whole name; ambiguous actions fail. browser.locator supports css and xpath for web-only tests.

  • when ai is used

    Selenium runs the WebDriver actions you scripted. it has no built-in runtime agent.

    e2e adds agent.act goals. cached goals replay recorded actions without a model; stale recordings can return control to the agent. tests with only locators never call a model.

  • languages, browsers, and scale

    Selenium supports five languages and vendor browsers, including Safari itself. grid distributes runs across remote machines.

    e2e uses TypeScript or JavaScript, with workers, shards, and hosted browser providers. it drives WebKit, Safari's engine, and runs native mobile tests without a separate Appium project.

01 / 05

[ side by side ]

feature by feature.

Selenium offers more languages and existing WebDriver infrastructure. e2e bundles the test runner and adds agent goals and native mobile support.

  • native mobile

    [ e2e ]

    [ e2e ]

    the same test file on iOS and Android

    [ selenium ]

    Appium, a separate project and suite

  • writing a test

    [ e2e ]

    [ e2e ]

    exact screen steps, agent goals, or both

    [ selenium ]

    findElement calls and actions in code

  • when the ui changes

    [ e2e ]

    [ e2e ]

    stale goals can return to the agent; exact assertions still check the result

    [ selenium ]

    update the scripted steps

  • waits

    [ e2e ]

    [ e2e ]

    actions wait, assertions retry

    [ selenium ]

    implicit, explicit, and fluent waits you write

  • ai assertions

    [ e2e ]

    [ e2e ]

    agent.assert, agent.waitFor, and agent.extract with a schema; vision for drawn content

    [ selenium ]

    value assertions from your test framework; no model-judged check

  • exploratory testing

    [ e2e ]

    [ e2e ]

    e2e explore runs from a goal and reports findings; a bug bash turns findings into failing repro tests

    [ selenium ]

    Selenium ide records and plays back what you click

  • runner and reports

    [ e2e ]

    [ e2e ]

    built in: JUnit, json, markdown, trace.md, video, pull request comment

    [ selenium ]

    your test framework and reporter

  • finding elements

    [ even ]

    [ e2e ]

    role, label, text, and test id queries, whole-string match; css and xpath through browser.locator

    [ selenium ]

    id, name, css, xpath, and link text; findElement takes the first match

  • browsers

    [ even ]

    [ e2e ]

    Chromium, Firefox, and WebKit builds through Playwright; WebKit is Safari's engine, not Safari itself

    [ selenium ]

    Chrome, Edge, Firefox, and Safari itself, each through its vendor's driver

  • languages

    [ selenium ]

    [ e2e ]

    TypeScript, JavaScript

    [ selenium ]

    Java, Python, C#, Ruby, JavaScript

  • parallel runs

    [ selenium ]

    [ e2e ]

    workers, shards, cdp, and browser providers

    [ selenium ]

    Selenium Grid and WebDriver-compatible clouds

  • windows and popups

    [ selenium ]

    [ e2e ]

    dialogs through browser.onDialog; windows the app opens are not driven yet

    [ selenium ]

    switchTo().window(), alert handling

  • automation outside tests

    [ selenium ]

    [ e2e ]

    a test runner; automation lives inside tests

    [ selenium ]

    a WebDriver client any program can call

[ which one ]

which one to pick.

pick by the job in front of you: first the jobs where e2e is the better choice, then the jobs where selenium is the better choice.

  • a new suite in TypeScript or JavaScript

    [ e2e ]

    the runner, assertions, traces, and reports come in one package.

  • a suite whose maintenance is mostly explicit waits and selector updates

    [ e2e ]

    the explicit waits go: actions wait for their target and assertions retry. a step rewritten as an agent.act goal follows ui changes; a locator step keeps its selector.

  • one suite for web and native mobile

    [ e2e ]

    the same test file runs on iOS and Android; Selenium needs a second project on Appium.

  • goals an agent completes beside exact checks

    [ e2e ]

    verified goals replay without model calls; Selenium has no agent layer.

  • a suite and a team in Java, Python, C#, or Ruby

    [ selenium ]

    e2e tests are TypeScript or JavaScript.

  • browser builds only a vendor driver reaches

    [ selenium ]

    Selenium drives each vendor's browser through its own driver; e2e drives Chromium, Firefox, and WebKit (Safari's engine) builds.

  • grid or a device cloud that speaks WebDriver

    [ selenium ]

    infrastructure worth keeping; e2e uses workers, shards, cdp, and browser providers instead.

  • browser automation that is not a test, such as a script or a bot

    [ selenium ]

    Selenium is a WebDriver client any program can call; e2e is a test runner.

[ switching ]

run both, move one flow at a time.

  1. [step 1]

    run npx e2e init in your app or a separate folder beside the existing suite.

  2. [step 2]

    follow the migration guide to port one flow and its config.

  3. [step 3]

    run npx e2e run <file>. keep the Selenium test until you trust the replacement.

the migration guide covers setup, api differences, and unsupported features. need help? book a call with the e2e team.

[ faq ]

questions.

what people on selenium ask before they add e2e.

[001]can e2e run my java or python selenium tests?

no. rewrite them in TypeScript or JavaScript, one flow at a time. keep both suites during migration.

[002]what's the difference between e2e and selenium?

Selenium automates browsers with the test framework of your choice. e2e bundles the runner, assertions, reports, and agent goals, with native mobile support.

[003]how does e2e replace explicit waits?

locator actions wait for their target, and assertions retry until they pass or time out. replace each explicit wait with the matching action or assertion.

[004]does e2e need an ai model?

only for agent steps. use a supported subscription, api key, or local model. locator-only tests need none.

[005]what about selenium grid?

e2e uses workers and --shard. connect to remote Chromium over cdp or use a browser provider. existing WebDriver infrastructure is a reason to keep Selenium.

[006]can i keep css and xpath selectors?

yes, through browser.locator, for web-only tests. role, label, and test id queries on screen also work on mobile.

ask anything else

facts checked 30 october 2026 against Selenium.dev (Selenium 4.52) and the e2e docs. something out of date? open an issue on github.

[ get started ]

your verificationlayerstarts withjust one command

npx e2e init