-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] isVisible returns true when an element is completely overlapped by another element #9923
Comments
This is our current definition of visible elements: https://playwright.dev/docs/actionability#visible If you have any suggestions, let us know then we can create a feature request out of it. |
Is there any workaround to check if an element is visible for humans? |
You can use: const smallBox = page.locator('#small-box');
await smallBox.click({ trial: true }); which will only perform the actionability checks and skips the click. It will fail when the element is not clickable. Would this work for your use-case? |
There are currently no plans for extending the isVisible API. Closing as won't fix. |
Greetings mxschmitt, I do not understand why Playwright chose this definition for visible elements as it is completely insufficient for testing purposes. |
I have found a solution to this. It is possible to test for a click at a specific Position within the element. So you can test that all corners of the element are clickable. As long as you can find out the size of the element. I defined a locator called "smallBox". |
Context:
Describe the bug
Here is an example of the div #small-box is completely overlapped by another div #big-box. The #small-box div is actually not visible, but playwright thinks differently
The text was updated successfully, but these errors were encountered: