Restore JS-click fallback for hidden elements#2452
Merged
soulgalore merged 3 commits intomainfrom May 2, 2026
Merged
Conversation
The 27.0.0 switch to the Selenium Actions API for click broke the documented hide-everything-then-click pattern that visual-metric scripts use to keep the click itself from triggering an early first visual change (e.g. the Wikipedia login script in our docs). For a display:none element the Actions API doesn't throw — it moves the pointer to the bounding-box center, which is (0,0) for a zero-size box, and clicks there, hitting nothing. For overlays and pointer-events:none cases it does throw. Either way, scripts that worked on 26.x silently or loudly stopped firing the click on 27.0.0. Pre-check isDisplayed() and use a JavaScript click when the element isn't displayed; otherwise try the Actions API and fall back to a JS click on any failure. Both fallbacks log at info so the path taken is visible without --verbose, and a final "both failed" case logs at error before rethrowing. The hidden-element case is covered by a new clickTest case that asserts from inside the navigation script so a silent miss can't be mistaken for success. Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com Change-Id: If9087f5c2a43cef98a8091260ecd6e2a63402c5b
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 27.0.0 switch to the Selenium Actions API for click broke the documented hide-everything-then-click pattern that visual-metric scripts use to keep the click itself from triggering an early first visual change (e.g. the Wikipedia login script in our docs). For a display:none element the Actions API doesn't throw — it moves the pointer to the bounding-box center, which is (0,0) for a zero-size box, and clicks there, hitting nothing. For overlays and pointer-events:none cases it does throw. Either way, scripts that worked on 26.x silently or loudly stopped firing the click on 27.0.0.
Pre-check isDisplayed() and use a JavaScript click when the element isn't displayed; otherwise try the Actions API and fall back to a JS click on any failure. Both fallbacks log at info so the path taken is visible without --verbose, and a final "both failed" case logs at error before rethrowing. The hidden-element case is covered by a new clickTest case that asserts from inside the navigation script so a silent miss can't be mistaken for success.
Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com
Change-Id: If9087f5c2a43cef98a8091260ecd6e2a63402c5b