What Is Selenium? The Browser Automation Standard Explained
Selenium is the long-established browser automation framework that drives real browsers through the WebDriver protocol from many programming languages.
Selenium has automated browsers for over a decade and remains a backbone of web testing in large enterprises. Its WebDriver standard, now a W3C specification, lets tests written in many languages control real browsers across operating systems.
What Selenium is
Selenium is a suite for browser automation. The core is WebDriver, a protocol and set of language bindings (Java, Python, C#, JavaScript, Ruby) for controlling browsers. Selenium Grid distributes tests across many machines and browsers, enabling large cross-browser test matrices.
How WebDriver works
Tests issue commands (navigate, click, type, read) through a language binding to a browser-specific driver that controls the real browser via the W3C WebDriver protocol. Because the protocol is standardized, the same test can target Chrome, Firefox, Edge, and others, locally or on a remote grid.
A test example
A Python example opens a page and reads the title.
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://example.com")
assert "Example" in driver.title
driver.quit()Role in CI/CD
In CI, Selenium runs cross-browser tests, often against Selenium Grid or a cloud browser provider to cover many browser/OS combinations. These runs are heavy and historically flaky, since older Selenium lacks built-in auto-waiting, so explicit waits are essential. Running them on faster managed runners with auto-retry on transient failures helps tame both speed and flakiness.
Alternatives
Playwright and Cypress are modern tools with auto-waiting and better developer experience out of the box. Playwright in particular targets multiple engines with less flakiness. Selenium endures because of its WebDriver standard, broad language support, and entrenched enterprise grids.
Key takeaways
- Selenium drives real browsers via the W3C WebDriver protocol.
- It supports many languages and distributes tests with Selenium Grid.
- Use explicit waits and auto-retry in CI to manage its known flakiness.