[docs] ADR: Selenium waits for interaction readiness, by default on BiDi sessions - #17886
Open
AutomatedTester wants to merge 1 commit into
Open
[docs] ADR: Selenium waits for interaction readiness, by default on BiDi sessions#17886AutomatedTester wants to merge 1 commit into
AutomatedTester wants to merge 1 commit into
Conversation
AutomatedTester
force-pushed
the
adr-interaction-readiness-waits
branch
2 times, most recently
from
August 6, 2026 10:37
181658f to
d03f066
Compare
Proposes that Selenium wait for interaction readiness before it acts: click, send_keys, clear and submit wait for the element to be actionable by default on a BiDi-enabled session, bounded by a new readiness timeout and raising today's interaction errors with the diagnosis appended. Classic sessions are unchanged, and a session toggle disables it. Readiness is modelled in three composable layers - a pending-work ledger, DOM settledness, and element actionability - also exposed as explicit protocol-neutral waits, with the semantics defined once in a shared JavaScript atom injected as a BiDi preload script, and framed as a prototype of a proposed BiDi quiescence module. Status: Proposed.
AutomatedTester
force-pushed
the
adr-interaction-readiness-waits
branch
from
August 10, 2026 08:29
d03f066 to
e71ef1c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📄 The decision, its rationale, considered options, and consequences are in the record file
this PR adds; read it there. The sections below are proposal notes and review logistics.
Updated: the record now proposes that readiness waiting be the default behavior on
BiDi-enabled sessions, not an opt-in wait users have to remember to call. Classic HTTP-only
sessions are unchanged. Earlier revisions of this PR deferred that question; it is now decision 2.
🔗 Related
py-quiescence-bidi-preload— the oracle as a shared JavaScript atom registered as a BiDi preload script, exposed asdriver.wait_for_dom_settledanddriver.wait_until_actionable, with ~1,500 lines of behavioral tests. Evidence that the semantics are implementable and testable; not proposed as the final API shape.quiescencemodule; no working-group issue filed yet.📝 Proposal notes
Why the default is gated on BiDi. Two reasons, and both have to hold:
evolving (17670). Behavior can change inside that opt-in without touching the timing of existing
classic-only tests.
watching mutation and motion from before the command arrives. Just-in-time injection starts at
the moment of the command, which makes "not moving" a guess rather than an observation.
What the default does and does not wait for. Actionability only — visible, enabled, editable
where the interaction writes, in the viewport, unobstructed, not moving. It deliberately does not
require DOM settledness or a quiet pending-work ledger: an application that long-polls or animates
continuously would otherwise pay a settle timeout on every click. Those two layers stay explicit.
The low-level Actions API does not auto-wait either.
Compatibility. A test that fails today fails the same way after this, later and with a better
message: an expired implicit wait raises
ElementClickInterceptedException/ElementNotInteractableException, not a timeout error, so existingcatch/exceptblocks keepmatching. Escape hatches are the new
readinesssession timeout (0disables) and a session-leveltoggle. The honest cost is that failing tests get slower, and existing BiDi users see changed
timing on upgrade.
Why one record. The three layers (pending work, DOM settledness, actionability) share a single
context and rationale, and the default is a composition of them — deciding them separately would
mean a reader has to open three records to understand any one of them.
Deliberately out of scope.
at full fidelity without a preload. Listed as a follow-up only as a possible reduced-fidelity
variant.
ExpectedConditions.elementToBeClickableand equivalents. Listed as a follow-up.working group, not to its shape.
Two places the record departs from the reference implementation. The prototype returns a result
record on timeout, where the record decides a timeout raises (Considered options 9–10, decision 5);
and the prototype implements only the explicit waits, so the default of decision 2 is proposed here
rather than demonstrated. Both are called out in the Appendix so neither is mistaken for an
oversight.
Cross-binding impact. Every binding gains two driver methods, a new session timeout, a session
toggle, the interaction-path change, and the packaging wiring to ship a JavaScript resource;
bindings that already ship atoms have most of the last part. Only the Python explicit waits have
been built. The project's own BiDi-enabled tests that expect immediate interaction errors will need
the toggle.
🗣 Discussion
Questions I would most like input on:
feedback? Considered option 6 rejects the staged rollout on the grounds that enabling BiDi is
already the opt-in and a second gate delays the feedback the heuristics need — but this is the
thing I would most like to be argued out of.
ElementClickInterceptedExceptionkeepsexisting error handling working, at the cost of an error whose name no longer describes the whole
story ("intercepted" now means "still intercepted after 10s"). Right trade?
readinesstimeout value. 10s is proposed. Playwright uses 30s. A high valuemakes failing suites slow; a low one makes the feature look unreliable on slow CI.
default path, where a false "not ready" turns a passing test into a timeout. Is the project
willing to own that, and is "best-effort, documented limits, one-line toggle" enough?
waitForDomSettled/waitUntilActionableon the driver.Better names, or do these belong somewhere other than the driver?
transport, until BiDi becomes the default. Is that acceptable as a transitional state?
Not yet discussed at a TLC meeting — requesting an agenda slot.
📌 Tracking
Tracking issue: (linked on acceptance)