-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] CSS attribute selector not working with a value with spaces #1996
Comments
I also faced into this issue. My example: |
This works for me locally, and on the bots (see the test in #2001). Am I missing something? |
Seems like it doesn't wait if an element with that property is one the page. Not sure if this is expected or not. const playwright = require("playwright");
(async () => {
const browser = await playwright.chromium.launch();
const page = await browser.newPage();
setTimeout(async () => {
await page.setContent(`<input placeholder="Select date"/>`)
}, 2000)
await page.click("[placeholder='Select date']")
await page.screenshot({ path: `example.png` });
await browser.close();
})(); interactive: https://try.playwright.tech/?s=f9dpl Error:
|
This is indeed a problem, nice catch! My test was only resolving when the element existed, and never when it was missing 🤦It seems like the deep css selector mishandles quotes, I'll make a fix shortly. |
Context:
Code Snippet
Describe the bug
The above snippet fails with:
The text was updated successfully, but these errors were encountered: