Migrate from Selenium
Inventory Selenium runners, page objects, waits, grids, data, and assertions; migrate a representative slice to ContextQA and verify behavior safely.
Quick answer
Migrate Selenium from a versioned repository, not from a list of test names. Identify the language and runner, page objects, waits, browser capabilities, Grid settings, data setup, helpers, and assertions; then use ContextQA’s MCP analysis and dry run for the supported repository. Translate business intent rather than copying locators or sleeps, map every external dependency, and verify the migrated case against the same build with both a passing control and a deliberately failing control.
Establish the source baseline
Record:
Repository and full commit SHA:
Language/runtime version:
Selenium version:
Test runner and version:
Dependency manifest/lockfile:
Test and page-object paths:
Default local command:
CI command:
Grid/driver configuration:
Required browser/capability matrix:
Baseline report and artifacts:
Suite owner:Run the source cohort at that exact revision. Preserve the test runner report, browser/driver versions, Grid session information when applicable, and failure diagnostics.
Inventory the Selenium architecture
Selenium is a browser automation library used through many languages and test runners. The repository structure, not the word “Selenium,” determines the migration work.
Runner and lifecycle
Language
Java / Python / C# / JavaScript / Ruby / other
Parser and helper review
Runner
JUnit / TestNG / pytest / NUnit / Mocha / other
Discovery, parameterization, setup, and result semantics
Setup scope
Test / class / suite / session
Destination prerequisite and cleanup design
Parallelism
Processes, threads, workers, Grid sessions
Test-plan capacity and data isolation
Retry plugin
Name and policy
Initial-versus-final result visibility
Reporter
JUnit XML, Allure, custom
Evidence and retention comparison
Page objects and helpers
Natural-language steps / API setup / custom code / retained
Do not translate a page-object method by its name alone. Read whether it includes conditional navigation, retries, JavaScript execution, frame/window switching, or assertions.
Waits and synchronization
Selenium’s official documentation identifies race conditions between the application and commands as a common cause of flaky tests. Inventory implicit waits, explicit waits, fluent waits, fixed sleeps, page-load strategies, and custom polling. See Selenium waiting strategies.
sleep(5000)
Unknown
Replace with investigated condition
Do not copy blindly
Element visible
UI readiness
Named control is visible/enabled
Express in step or assertion
API response complete
Data readiness
Stable network or UI state
API prerequisite or explicit condition
Download present
File completion
File and contents available
Verify supported workflow separately
Remove a wait only when the migrated workflow has another observable readiness condition. Removing every wait without understanding it can turn flakiness into false failures.
Browser and Grid capabilities
Browser/version
Test-plan machine / external remote profile / retain
OS/device
Resolution
Locale/timezone
Proxy/certificate
Proxy/remote-browser profile / retain
Downloads/uploads
Verify scenario
Concurrency
Workspace/external capacity
Use the browser-grid migration checklist before changing Grid ownership.
Step 1: Analyze without changing the workspace
From an approved MCP client:
Reconcile the count with the inventory. Mixed frameworks, generated tests, nonstandard naming, or runner-specific factories may require a narrower path or manual inventory.
Step 2: Dry-run a representative cohort
Choose:
one linear UI case;
one page-object-heavy case;
one parameterized/data-provider case;
one frame, window, shadow DOM, download, or file-upload case if required;
one test with API/database setup;
one negative permission case; and
one historically flaky test.
Treat an unsupported case as a planning result. Decide whether to reconstruct it, keep it in Selenium, replace it with another control, or retire it with approval.
Step 3: Map source mechanics to ContextQA
Locator sequence
Intent-based test steps
Does the step identify a stable user action?
Assertion library
Verification step, API assertion, or custom code
Is the business outcome preserved exactly?
Page object
Several steps or reusable approved pattern
Are hidden branches and waits visible?
Data provider
Test data profile
Are rows isolated, synthetic, and resettable?
Environment property
Environment variable
Is the correct build/config used?
Secret
Password/vault or CI secret
Is the value absent from test text/evidence?
Setup/teardown hook
Prerequisite, API step, cleanup workflow, or retained job
Does failure stop the test visibly?
Grid capabilities
Test-plan machine or verified remote-browser profile
Does observed coverage match the requirement?
JavaScript executor
Supported step/custom code/manual redesign
Is the behavior a user contract or implementation workaround?
Runner retry
Plan/test setting and team release policy
Are first failure and retry visible?
Step 4: Create and review the pilot
After the real migration returns created ContextQA test references:
Compare every step with the behavior packet.
Inspect assertions in the test method, page objects, and helper libraries.
Replace source credentials and URLs with approved ContextQA configuration.
Rebuild required setup and cleanup before executing.
Group accepted cases into a pilot suite and saved test plan.
Keep unreviewed migrated cases outside release-blocking plans.
Step 5: Compare execution
Classify differences as product, test, data, environment, browser/driver, timing, or unknown. A ContextQA pass and Selenium failure—or the reverse—is an investigation trigger, not an automatic winner.
Step 6: Validate readiness and negative controls
For one timing-sensitive case:
Remove or delay the expected readiness condition in a disposable fixture.
Confirm the migrated test does not pass before the application is ready.
Restore the condition and verify a normal pass.
Record whether retries were used.
For one critical assertion:
Change the expected business result in a disposable build.
Verify both the Selenium and ContextQA cases fail for that reason.
Restore and rerun.
This distinguishes a stable migration from one that merely stopped exercising the risky condition.
Step 7: Handle what should remain in Selenium
Keep a case in Selenium when it depends on an unverified browser capability, proprietary helper, low-level protocol operation, unsupported integration, or code-review requirement that ContextQA has not demonstrated for the intended use.
Record:
Hybrid ownership is acceptable. Ambiguous ownership is not.
Selenium migration checklist
Common migration traps
Related documentation
Last updated
Was this helpful?
