I'm trying to make a locator based on a getBy locator that returns only the visible elements. Is this possible?
Chaining a getBy locator with visible=true doesn't work: getByRole('textbox') >> visible=true And the documentation doens't show a visible filter option, for the getBy locators. I'm I missing something?
As suggested here, you can filter out not visible fields using this:
page.getByText('Waiting for response...', { exact: true }).locator('visible=true');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With