Comments (2)
I understand that it's not planned to address the timing issues on your side, but I would like to at least get some documentation about the fact that all locators ignore invisible elements completely.
To me it is also surprising that the following page
<div>
<button
name="senddata"
style="display: none;"
>
<span>Agree to all</span>
</button>
<button
name="senddata"
>
<span>Agree to all</span>
</button>
</div>
with this locator call page.getByRole('button', { name: 'Agree to all' }).click()
does not raise a strict mode violation.
Especially since there is a special section in the documentation that is telling you exactly the opposite should be the case. This seems very inconsistent to me.
from playwright.
The locator generator acts based on the current state of the page, it doesn't know if one of currently invisible elements will become visible or a new element matching same locator is going to be added by javascript later (or the order of elements may change etc.). If you know that the locator is not going to be unique, you can call the generator when the page is in appropriate state or you can always alternate the result to be more resilient to changes in the page.
Closing this issue as not planned.
from playwright.
Related Issues (20)
- [Feature]: merge Playwright Inspector into trace view
- page.evaluate returns empty object HOT 6
- [Bug]: Network mocking does not work for initial request when page opened via extension API `chrome.tabs.create()`
- [Docs]: Adding Theatron to third-party reporter showcase HOT 1
- [Bug]: --ignore-snapshots option doesn't work when combined with --ui mode HOT 3
- [Bug]: `Locator.focus` does not respect the default timeout of 0 (no timeout) HOT 2
- [Bug]: Playwright ui is not showing any tests HOT 4
- [Feature]: Timeout Differentials
- [Bug]: Unable to Locate SVG(Scalable Vector Graphics) Icon Element HOT 1
- [Feature]: Add Official Playwright Logo SVG to Project Assets HOT 3
- [Feature]: Global Timeout for toHaveScreenshot()
- [Bug]: cdpsession.on() seems not work. HOT 8
- [Bug]: Unable to turn off GeoLocation or block a given website from accessing the GeoLocation feature. HOT 2
- [Feature]: Use system wide webview HOT 1
- [Bug]: `LaunchAsync` finishes with `TimeoutException` on Chrome HOT 1
- [Bug]: proxy not working for any browser HOT 5
- [Bug]: Playwright locator from generateLocator refers to the wrong html element HOT 1
- [internal]: remove screenshot-instead-of-snapshot usages
- Executing the Playwright automation suite before the Pull Request get merged into main branch HOT 2
- [Feature]: Add `page.clock` method to check if `page.clock.install()` was called HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.