[BUG] Chromium: Cannot click, element intercepts pointer events

See original GitHub issue

Context:

  • Playwright Version: 1.20.0
  • Operating System: Windows10
  • Node.js version: LTS 16
  • Browser: Chromium only

Describe the bug Trying to click on the ElementHandle, located by ElementHandle.waitForSelector() - fails in Chroimum with error

attempting click action
      waiting for element to be visible, enabled and stable
      element is visible, enabled and stable
      scrolling into view if needed
      done scrolling
      performing click action
      <span class="selection">…</span> intercepts pointer events

Works fine in Webkit and Firefox, was working fine in all browsers before 1.20.0 upgrade.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jnizetcommented, Mar 17, 2022

Hi @dgozman

Here’s a repro for the chromium issue. Steps to reproduce:

  • unzip the repro.zip file. It contains an index.html and some assets that have been generated by exporting a page of my actual Angular-based application.
  • cd into playwright-repro
  • run a web server serving files in that directory, on port 8080 (I use the http-server NPM package)
  • execute the following test file (with playwright 1.20). The first test fails on chromium only. The other two are workarounds to make the test pass.
import { test } from '@playwright/test';

test.describe('Activities', () => {
  test('should click activities', async ({ page }) => {
    await page.goto('http://localhost:8080/index.html');
    const romimineCard = page.locator('.card', { hasText: 'Romimine' });
    await test.expect(romimineCard.locator('h3')).toHaveText('Romimine');

    await page.click('text=Romimine');
  });

  test('should click activities with force', async ({ page }) => {
    await page.goto('http://localhost:8080/index.html');
    const romimineCard = page.locator('.card', { hasText: 'Romimine' });
    await test.expect(romimineCard.locator('h3')).toHaveText('Romimine');

    await page.click('text=Romimine', { force: true });
  });

  test('should click activities with a', async ({ page }) => {
    await page.goto('http://localhost:8080/index.html');
    const romimineCard = page.locator('.card', { hasText: 'Romimine' });
    await test.expect(romimineCard.locator('h3')).toHaveText('Romimine');

    await page.click('a:has-text("Romimine")');
  });
});

repro.zip

1reaction
jnizetcommented, Mar 19, 2022

Thanks for the investigation and the workaround @dgozman. It fills me with joy to have “Romimine”, which is the name we gave to the cat living in our garden, now part of the codebase of Playwright and used to fix an issue in chromium. 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Misfired pointer events in nested iframes on Chromium 78
Just an idea for a workaround: you could compare the coordinates in the out/leave events to the last known position inside the button...
Read more >
466167 - Chrome click / touch event is not working ... - Monorail
Click events only fire when a finger is used to touch the element, but not when it's clicked with a cursor. Disabling touch...
Read more >
How To Deal With "Element is not clickable at point” Exception ...
WebElement to be clicked is disabled. · WebElement is not yet available (or loaded) on the web page. · WebElements overlap with each...
Read more >
WebDriver - W3C
An element is said to have pointer events disabled if the resolved value of its ... return error with error code element click...
Read more >
Element click intercepted - not clickable at point - Other ...
That is the reason Selenium Click was not able to click on element. Search button is overlapped by an auto suggestion option. Exception...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found