Playwright Text input

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.
Thu, 11/24/2022 - 13:31
Ashwin possesses over five years of experience in the Quality Assurance industry and is currently serving as a Technical Lead at iVagus. His expertise encompasses a broad range of technologies, including Cypress, Rest Assured, Selenium, Cucumber, JavaScript and TypeScript.
Tags

Comments