Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Using force:true to click on an element overlapped by another element will not click or error out #30845

Closed
adrianmaciuc opened this issue May 16, 2024 · 2 comments

Comments

@adrianmaciuc
Copy link

Version

1.40

Steps to reproduce

  1. Navigate to google in incognito mode
  2. Do not click the user consent
  3. Input random text in search field
  4. Attempt to click search using force:true

Expected behavior

Click to be performed OR Playwright to error out that click was not performed and test to fail

Actual behavior

Click is not performed, test will pass

Additional context

test("The force", async ({ page }) => {
  await page.goto("https://www.google.com/");
  
  // the search input field
  await page.locator('textarea').first().fill("martioli")
  // the search button
  await page.locator('[type=submit][name="btnK"]').last().click({ force: true })
});

if I would add an extra step to accept the consent popup, then it would click the search button with no problem.

Environment

CPU: (4) x64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
    Memory: 8.81 GB / 15.91 GB
  Binaries:
    Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.89.1 - C:\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.40.0 => 1.42.1
@yury-s
Copy link
Member

yury-s commented May 16, 2024

Do not click the user consent

There is no user consent dialog and the test passes for me just fine. Please provide a self contained test with page that doesn't depend on third-party, so that we could reproduce it locally.

@yury-s
Copy link
Member

yury-s commented May 20, 2024

We need more information to act on this report. Please file a new one and link to this issue when you get back to it!

@yury-s yury-s closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants