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

[Question] Query by text with space #4318

Closed
maraisr opened this issue Nov 3, 2020 · 3 comments
Closed

[Question] Query by text with space #4318

maraisr opened this issue Nov 3, 2020 · 3 comments

Comments

@maraisr
Copy link
Member

maraisr commented Nov 3, 2020

Is there an ability to query for a selector that has extraneous space around it? I'm left to "test" some legacy Angular.js apps, which are notorious for this.

image

my await page.waitForSelector('"What does your Ford Focus need?"') is never resolving, and upon DEBUG mode it never resolves.

image

other elements I query do however work, so it could either be the dodgy space in there—or the fact that part of the "text" is nested in a span?

@mxschmitt
Copy link
Member

mxschmitt commented Nov 3, 2020

Hi, it does not work because your text is in multiple elements. Seems like its related or the same feature requests as in #2089.

@maraisr
Copy link
Member Author

maraisr commented Nov 3, 2020

Ouch! Is there a workaround for this atm? xpath something?

@JoelEinbinder
Copy link
Contributor

Closing as a duplicate of #2089. But I agree that angular apps are a very good use case for this. cc @dgozman

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

3 participants