w3c / w3c/webdriver

Element click behavior on touchscreen devices

Open
#1,925 11 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

This is a follow-up from the Chrome Driver issue https://issues.chromium.org/issues/42320346.

The element click spec currently assumes a mouse interaction. However, it is desirable for element click to produce touch events (touchstart, touchend) when webdriver tests are run on touchscreen mobile devices, as a real user would use a tap gesture there, and many mobile sites are listening only for touch events.

Some corner cases need to be considered here:

  • A desktop device with a touchscreen could mean there is a mouse as well as a touchscreen, in which case generating touch events by default may not be desirable.
  • When emulating a mobile touchscreen device on desktop, it may need to behave similar to a real touchscreen-only device and generate touch events there as well.

It would be good to get clarification on whether touch events should be generated when performing an element click and how to ensure it is done where only touch and no mouse interactions are expected.

Alternatively, should there be a separate element tap command instead?

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 linked WebDriver element click specification and the referenced Chrome Driver issue. Review the touchscreen-only, desktop-touchscreen, and emulated-mobile cases described here, then determine whether element click should generate touch events or whether a separate tap command is needed. Done means the behavior and applicable cases are clarified in the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.