Skip to content

Instantly share code, notes, and snippets.

@minhphong306
Created June 29, 2025 07:50
Show Gist options
  • Save minhphong306/6fdf08545af58a26e31078257dbbfb4d to your computer and use it in GitHub Desktop.
Save minhphong306/6fdf08545af58a26e31078257dbbfb4d to your computer and use it in GitHub Desktop.
Code need help
import { test } from '@playwright/test';
test("Register", async ({ page }) => {
await page.goto('https://material.playwrightvn.com/');
await page.click('//a[@href="01-xpath-register-page.html"]');
await page.locator('//input[@id="username"]').fill('Trangdt98');
await page.locator('//input[@id="email"]').fill('[email protected]');
await page.locator('//input[@id="female"]').check();
await page.locator('//input[@id="traveling"]').check();
await page.locator('//select[@id="country"]').selectOption({ value: "usa" });
await page.locator('//input[@id="profile"]').setInputFiles("D:/pw-course (1)/Data/165522424_10225222190398060_7591752606277882188_n.jpg");
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment