Why Doesn't the getByPlaceholder Locator Work in Playwright?

This topic was automatically generated from Slack. You can find the original thread here.

why does the getByPlaceholder locator not work in playwright?

The getByPlaceholder locator is not a standard method provided by Playwright. Playwright offers a set of locator strategies to target elements, such as page.locator(selector) where selector can be a string using CSS selectors, text selectors, or other Playwright-specific selector engines. If you are trying to locate an element by its placeholder text, you would typically use a CSS attribute selector or XPath. For example, to find an input element with a specific placeholder, you might use: ```
const input = page.locator(‘input[placeholder=“Your Placeholder Text”]’);

That link doesn’t work - fyi

According to the dev site, the getByLocators are a standard method:

What locators can I use in Pipedream for Playwright?