w3c / w3c/webdriver

"Element Click" should consider overlay elements

Open
#1,301 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Element Click
Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Currently, the WebDriver specification for the Element Click action reads: "The Element Click command scrolls into view the element".

I believe this term is not sufficient. The current specification ignores the impact of having overlay elements in the document (e.g. absolutely/relatively/fixed/sticky positioned elements). These elements are widely used throughout the web.

So, cross-browser testing is currently impossible. It's even impossible to test a page containing overlay elements on the same browser with the exactly same viewport dimensions.

So, I suggest the specification to read: "The Element Click command scrolls into view the element. Further, it scrolls the element within view until at least one pixel of the element is not covered by any overlaying element. If no such position within view can be found, the element is regarded 'unclickable'."
See this example:

In this example, recorded using current WebDriver implementations, there is a fixed <div> element at the bottom of the page, overlaying the page's content. This causes current WebDriver implementations to fail a recorded test:

overlays not considered - short

Finding an element's scolling position that's providing a loophole in a viewport region containing arbitrary overlays isn't trivial, but undoubtably a necessity for testing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WebDriver specification's Element Click section and review the provided fixed

overlay example. Investigate how overlay elements affect scrolling and clickability across browser implementations. Done means the specification has an agreed, implementable treatment for covered elements and the cross-browser testing concern is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
testing-qa, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.