Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pablocattaneo/f5dae32c3ff9f6c766238241f545bc51 to your computer and use it in GitHub Desktop.

Select an option

Save pablocattaneo/f5dae32c3ff9f6c766238241f545bc51 to your computer and use it in GitHub Desktop.
// It is possible using .and locator https://playwright.dev/docs/api/class-locator#locator-and
import { test, expect } from "@playwright/test";
test(" Text input actions", async ({ page }) => {
await page.goto("https://testautomationpractice.blogspot.com/");
const textBox = page.getByRole('textbox').and(page.locator("#name"));
await textBox.fill("Playwright");
await expect(textBox).toHaveValue("Playwright");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment