Skip to content
Advertisement

How do you match against an OR case in Playwright?

The Playwright documentation says “Comma-separated list of CSS selectors will match all elements that can be selected by one of the selectors in that list.” but it doesn’t work.

If I do this:

JavaScript

it matches, but if I do this:

JavaScript

it hangs

Is this not a “CSS selector”? how do I do the equivalent properly?

Advertisement

Answer

Yes, this is not a CSS selector. However, you can do it this way:

JavaScript
Advertisement