Chapter 26Lesson 01~205 minutes

Selenium IDE, Record/Playback, and Migration to Maintainable Code: Core Concepts and Mental Model

Use Selenium IDE to observe and prototype browser interactions without confusing a captured sequence with a durable test design. This lesson separates IDE commands from WebDriver responsibilities before any migration work begins.

Selenium IDERecord/playbackCommand semanticsMigrationEvidence

Learning objectives

  • Explain what recording observes—and what architecture it cannot infer.
  • Map IDE command/target/value records to browser and AUT state.
  • Distinguish Selenium IDE versioning from Selenium WebDriver versioning.
  • Inspect Selenium/browser/session state before mutating a test flow.
  • Identify the responsibilities added during migration to maintainable code.

1. The practical problem: recorded success is not maintained intent

Recording is attractive because it turns a visible browser interaction into a sequence quickly. The danger appears later: the recording knows what happened on one page shape at one moment, but it does not know why the business scenario matters, which locator is an intentional contract, whether the application was ready, which data is disposable, or what evidence CI must preserve.

That means an IDE recording can be useful raw material while still being a poor production test. A durable test must make dependencies, synchronization, assertions, fixtures, abstraction ownership, failure evidence, environment configuration, and cleanup explicit.

Never record real secrets

Use only the loopback fixture and synthetic values in this chapter. Recorder command values, screenshots, project files, exports, and playback logs can become artifacts. Production credentials, MFA codes, real customer data, and privileged sessions do not belong in them.

2. Mental model: observation first, architecture second

The following diagram visualizes the relationships described in Mental model: observation first, architecture second. Read the nodes in sequence and use the arrows to connect the conceptual state changes to the explanation around the diagram.

Observation first, architecture second
flowchart TD
  U[Human action in browser] -- recorded as --> I[IDE command + target + value]
  I -- playback --> B[Browser + current DOM state]
  B -- changes --> A[Disposable AUT state]
  I -. does not infer .-> R[Test intent + fixture + waits + assertions + diagnostics]
  R -- migration --> W[Maintainable WebDriver test]
  W -- classic commands --> B

The solid arrows describe recording and playback: an observed action becomes an IDE command with a target and optional value, and playback tries to execute that command against the DOM that exists then. The dotted arrow is the important limitation: architecture is not inferred automatically. Migration adds the responsibility model from Chapters 13–25.

3. Command, target, value, context, and state

The following table organizes the key choices and evidence for Command, target, value, context, and state. Use it together with the surrounding prose so the rows serve as a comparison aid rather than standalone rules.

Term Meaning Example / state touched
Command The operation to perform or check. open, type, click, assert text, or an element wait.
Target The object/location the command addresses. A URL or locator such as id=display-name.
Value Input or expected value used by a command. Synthetic text such as Ada or expected saved:Ada.
Playback context The current window/tab/frame and current DOM. A locator can be valid in one context and absent in another.
AUT state Server/client state changed by actions. Clicking Save changes the fixture status from idle to saving to saved:Ada.
IDE project state Recorded tests, suites, commands, locators, variables. A .side-style learning artifact; treat values inside as potentially sensitive.

4. Version boundaries are part of evidence

Selenium IDE and Selenium WebDriver do not share one release number. As of this chapter’s August 2026 verification, Selenium WebDriver Python is stable at 4.47.0. The SeleniumHQ IDE repository’s latest GitHub release is v4.0.1-beta.14, published July 20, 2024. The repository describes the current IDE as an Electron application available from release binaries or npm.

Therefore, record the IDE build separately from the binding/browser/driver versions. A learner following an older browser-extension tutorial can encounter a different UI or capability surface even though the underlying lesson—recording is not architecture—remains valid.

5. Read-only inspection before migration

Before changing locators or exporting anything, prove the WebDriver environment you will migrate into. This is deliberately the same read-only habit used throughout the course.

from selenium import __version__ as selenium_version
from selenium import webdriver
import platform

print("selenium", selenium_version)
print("python", platform.python_version())
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
print("requested", options.to_capabilities())

driver = webdriver.Chrome(options=options)  # Selenium Manager resolves the driver
try:
    caps = dict(driver.capabilities)
    print("session", driver.session_id)
    print("browser", caps.get("browserName"), caps.get("browserVersion"))
    print("platform", caps.get("platformName"))
    print("url", driver.current_url)
    print("title", driver.title)
finally:
    driver.quit()

Also record the installed IDE build from its About/version UI (or the package/release you installed), the project name, test name, base URL, and whether playback is local. Do not paste secrets into version evidence.

6. What migration must add

The following table organizes the key choices and evidence for What migration must add. Use it together with the surrounding prose so the rows serve as a comparison aid rather than standalone rules.

Recorded artifact usually gives you Maintainable test must decide
An observed locator Whether it is stable, scoped, meaningful, and portable.
A click/type sequence Which methods represent page services or task intent.
Playback timing Which explicit condition means the application is ready.
A literal input value How test data is parameterized, synthetic, and isolated.
An IDE assertion Where assertion meaning belongs and what evidence is captured on failure.
One interactive run How driver lifecycle, configuration, cleanup, CI, and cross-browser execution work.

7. DevOps connection: treat recording as source material

In a delivery system, a maintainable test must be code-reviewed, version-controlled, runnable by one provider-neutral command, and diagnosable without reopening the recorder. IDE artifacts can remain useful for reproducing a short interaction or teaching a flow, but they should not become an opaque second production framework beside the WebDriver suite.

Knowledge checks

Answer from the operating model, then reveal the explanation.

A recorded click works today. What has the recorder proven?

Why record the IDE version separately from selenium==4.47.0?

A .side file contains a synthetic password. What class of state is that?

Should an IDE recording decide where production assertions live?

What is the first useful migration action before rewriting commands?

Summary and next bridge

  • Recording captures observed interactions, not business/test architecture.
  • IDE commands execute against current browser context and DOM state.
  • Selenium IDE and WebDriver have independent version/support surfaces.
  • Migration must add stable locators, synchronization, fixtures, abstractions, evidence, and cleanup.
  • IDE artifacts are potentially sensitive and remain secondary to maintainable source code.

Lesson 2 records and inspects a disposable local profile flow, deliberately breaks a recorder-style locator, and migrates the repaired scenario into Python WebDriver.

Next lesson

Selenium IDE, Record/Playback, and Migration to Maintainable Code: Guided Hands-On Workflow

Continue with Selenium IDE, Record/Playback, and Migration to Maintainable Code: Guided Hands-On Workflow. It builds directly on the state, evidence, and operating assumptions established here, so carry those constraints forward rather than treating the next page as an isolated topic.

Primary references and version notes

Version baseline — August 2026

The WebDriver examples pin selenium==4.47.0 and Python 3.10+. Selenium Manager remains the normal local driver-resolution path. Selenium IDE is versioned separately: the SeleniumHQ repository currently marks v4.0.1-beta.14 as its latest GitHub release, published July 20, 2024. Official IDE Code Export documentation lists C# NUnit, Java JUnit, JavaScript Mocha, and Python pytest, but the mandatory course path still verifies the installed IDE build and migrates manually so recorded/exported code is never treated as authoritative architecture.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.