Playwright Text input

Profile picture for user arilio666

The playwright has 'fill,' which will quickly fill out form fields. It focuses primarily on the element and triggers input events with the provided text.

Syntax:

page.locator().fill('Value')

Example:

const {test, expect} = require('@playwright/test');
test('ElementHandle', async ({page})=> 
{
await page.goto("http://autopract.com/selenium/iframe1/");
const framePage = await page.frameLocator('iframe[title="Iframe Example"]');
await framePage.locator('.form-control').nth(0).fill('ash');
await framePage.locator('.form-control').nth(1).fill('ash@yahoo.com');
await framePage.locator('.form-control').nth(2).fill('password!@#$');
await framePage.locator('.form-control').nth(3).fill('assword!@#$');



});
Fill Report
  • So as witnessed using fill, the form has been filled successfully.