Fill Input Fields
Playwright provides two ways to enter text:
locator.fill(value)— clears the field first, then types the value (recommended)locator.pressSequentially(text)— types one character at a time (simulates real typing)
Task:
- Navigate to
https://testkru.com/Elements/TextFields - Find the last name field (ID:
lastNameWithPlaceholder) - Fill it with "Playwright"
- Print its value
- Clear it and fill with "Automation"
- Print its new value
Expected output:
First fill: Playwright Second fill: Automation
TestKru