
ALT Screenshot of the Playwright releases page with the following text: Locators With these new APIs, inspired by Testing Library, writing locators is a joy: * page.getByText(text, options) to locate by text content. * page.getByRole(role, options) to locate by ARIA role, ARIA attributes and accessible name. * page.getByLabel(label, options) to locate a form control by associated label's text. * page.getByPlaceholder(placeholder, options) to locate an input by placeholder. * page.getByAltText(altText, options) to locate an element, usually image, by its text alternative. * page.getByTitle(title, options) to locate an element by its title. await page.getByLabel('User Name').fill('John'); await page.getByLabel('Password').fill('secret-password'); await page.getByRole('button', { name: 'Sign in' }).click(); await expect(page.getByText('Welcome, John!')).toBeVisible();






















