openskills.info
Selenium Fundamentals logoCourse Preview

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

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