Selenium Fundamentals
Selenium controls real web browsers from code. Tests use WebDriver commands to open pages, find elements, perform user actions, and check what the application displays across supported browsers.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Selenium Fundamentals
Selenium is a way for code to control a real web browser. Your program asks for a page, finds an element, clicks or types, and inspects what happened. The browser still renders the site and runs its JavaScript. Selenium is holding the controls, not replacing the aircraft.
The central piece is WebDriver, a standard command protocol. Language-specific client libraries turn method calls into protocol messages. A local driver consumes them directly; a Grid endpoint assigns them to an available browser node. Results come back to the test, accompanied occasionally by an exception that is far more informative than its timing suggests.
Everything happens inside a session, meaning one controlled browser instance. Create it with browser options, use its identifier for later commands, then quit it. Selenium Manager can find and cache a compatible driver when you have not supplied one. This removes a famous setup nuisance, though controlled and offline environments can still choose their binaries explicitly.
Three ideas carry most of the subject. First, a locator is the recipe for finding an element. Stable IDs and dedicated test attributes age better than selectors that reproduce the page's decoration. Second, an element is a reference to one particular document node. If a render replaces that node, the old reference becomes stale. The browser is not confused; the test is holding yesterday's doorknob.
Third, browser automation is mostly an argument about time. A page can exist before its data, and an element can exist before it can accept a click. An explicit wait polls for the state you need, such as visibility or clickability. A fixed sleep polls nothing at all. It waits the whole duration when the application is fast and fails when the application is slower, an impressive way to purchase both delay and uncertainty.
The current browsing context also matters. A valid locator cannot find an element in another frame or window until the test switches there. When a click is intercepted, inspect what covers the target. When an element is stale, locate it again after the render. When no element appears, check context and timing before composing a longer XPath in a mood of grim determination.
Grid moves sessions to remote browser nodes and can run many combinations in parallel. It adds a queue, routing, capacity, network latency, and remote logs. More nodes shorten a suite only when tests do not fight over the same users and records. Parallel confusion is still confusion, merely better funded.
Read the Intro next for architecture, failure behavior, test design, and where Selenium fits. Keep the Cheatsheet nearby for locators, waits, exceptions, and Grid modes. Use the Practice tab when writing a first synchronized test, then the Exercise to prove that failures leave evidence and browser processes do not linger. The Timeline explains why modern Selenium looks unlike its JavaScript-in-the-page ancestor.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.selenium.dev/documentation/overview/
Supports
- Selenium project components and intended roles
- WebDriver and Grid positioning
- https://www.selenium.dev/documentation/overview/components/
Supports
- Language bindings, drivers, WebDriver, Grid, and IDE relationships
- https://www.selenium.dev/documentation/webdriver/getting_started/first_script/
Supports
- Python session, navigation, locator, interaction, and teardown example
- Official Selenium web form used by the exercise
- https://www.selenium.dev/documentation/webdriver/drivers/
Supports
- Local and remote driver configuration
- Options and capabilities
- https://www.selenium.dev/documentation/selenium_manager/
Supports
- Automated driver and browser management
- Discovery, download, cache, and binding integration
- https://www.selenium.dev/documentation/webdriver/elements/locators/
Supports
- Eight traditional locator strategies
- Locator syntax and behavior
- https://www.selenium.dev/documentation/webdriver/elements/finders/
Supports
- Singular and plural element lookup
- Nested, active-element, and shadow-root lookup
- https://www.selenium.dev/documentation/webdriver/elements/information/
Supports
- Element text, attributes, properties, state, rectangle, and CSS values
- https://www.selenium.dev/documentation/webdriver/elements/interactions/
Supports
- Click, send keys, clear, submit, and interactability
- https://www.selenium.dev/documentation/webdriver/actions_api/
Supports
- Keyboard, pointer, pen, and wheel input sequences
- https://www.selenium.dev/documentation/webdriver/waits/
Supports
- Explicit, implicit, and fixed waiting behavior
- Warning against mixing implicit and explicit waits
- https://www.selenium.dev/documentation/webdriver/support_features/expected_conditions/
Supports
- Expected condition types and explicit-wait examples
- https://www.selenium.dev/documentation/webdriver/interactions/frames/
Supports
- Frame switching and current browsing context
- https://www.selenium.dev/documentation/webdriver/interactions/windows/
Supports
- Windows, tabs, close, and quit behavior
- https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/
Supports
- No such element, stale element, click intercepted, interactability, and session errors
- Element references do not relocate automatically
- https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/
Supports
- Remote session construction and options
- https://www.selenium.dev/documentation/grid/
Supports
- Remote routing, parallel execution, and platform matrices
- https://www.selenium.dev/documentation/grid/getting_started/
Supports
- Standalone server command and default endpoint
- https://www.selenium.dev/documentation/grid/components/
Supports
- Router, distributor, session queue, session map, event bus, and nodes
- https://www.selenium.dev/documentation/grid/advanced_features/observability/
Supports
- Grid tracing, logs, and observability
- https://www.selenium.dev/documentation/test_practices/encouraged/page_object_models/
Supports
- Page Object responsibilities and assertion placement
- https://www.selenium.dev/documentation/test_practices/encouraged/avoid_sharing_state/
Supports
- Isolated state and fresh per-test data guidance
- https://www.selenium.dev/documentation/test_practices/encouraged/test_independency/
Supports
- Independent test execution and order isolation
- https://www.selenium.dev/documentation/test_practices/encouraged/fresh_browser_per_test/
Supports
- Fresh browser session per test guidance
- https://www.selenium.dev/documentation/test_practices/discouraged/performance_testing/
Supports
- Selenium is a poor fit for performance load testing
- https://www.selenium.dev/documentation/webdriver/bidi/
Supports
- Bidirectional event-driven browser automation
- Logs, network, script, and browsing-context domains
- https://www.w3.org/TR/webdriver2/
Supports
- Standard command, session, capability, element, and error semantics
- https://www.selenium.dev/history/
Supports
- Selenium Core origin in 2004
- Remote Control, IDE, Grid, and WebDriver origins
- https://www.selenium.dev/blog/2011/selenium-2-0/
Supports
- Selenium 2.0 release date and WebDriver APIs
- Grid 2 inclusion
- https://www.selenium.dev/blog/2016/selenium-3-0-out-now/
Supports
- Selenium 3.0 release date
- Selenium Core removal and vendor drivers
- https://www.w3.org/TR/2018/REC-webdriver1-20180605/
Supports
- WebDriver W3C Recommendation date and scope
- https://www.selenium.dev/blog/2021/announcing-selenium-4/
Supports
- Selenium 4 release date
- Grid redesign, relative locators, GraphQL, and OpenTelemetry
- https://www.selenium.dev/blog/2022/selenium-4-6-0-released/
Supports
- Selenium 4.6 release date and initial Manager integration
- https://www.selenium.dev/blog/2022/introducing-selenium-manager/
Supports
- Driver-management motivation and initial behavior
- https://www.selenium.dev/blog/2023/selenium-4-11-0-released/
Supports
- Selenium 4.11 release date
- Chrome for Testing support and Manager diagnostics
- https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html
Supports
- Suite-level impact of small per-test flake rates
- Quarantine and retry as mitigation rather than root-cause repair
- https://github.com/christian-bromann/awesome-selenium
Supports
- Discovery source for Awesome Links tools and services
- https://webdriver.io/
Supports
- WebdriverIO runner, assertions, services, and reporting placement
- https://selenide.org/
Supports
- Java Selenium wrapper and condition-based waiting placement
- https://robotframework.org/SeleniumLibrary/
Supports
- Robot Framework keyword library for Selenium
- https://appium.io/docs/en/latest/
Supports
- WebDriver-family automation for mobile and app platforms
- https://github.com/SeleniumHQ/docker-selenium
Supports
- Official Selenium Standalone and Grid container images
- https://aerokube.com/selenoid/latest/
Supports
- Container-launched browser sessions, video, and logs
- https://www.browserstack.com/automate
Supports
- Hosted Selenium browser and operating-system execution
- https://saucelabs.com/products/platform-for-test
Supports
- Hosted Selenium execution, artifacts, and analytics
- https://www.lambdatest.com/selenium-automation
Supports
- Hosted Selenium remote browser matrix
- https://testingbot.com/
Supports
- Hosted Selenium desktop and mobile browser execution
