fill(selector, value[, options])
Fill an input
, textarea
or contenteditable
element with the provided value.
Returns
Type | Description |
---|---|
Promise<void> | A Promise that fulfills when the element is filled with the value. |
Example
import { browser } from 'k6/browser';
export const options = {
scenarios: {
browser: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
await page.goto('http://test.k6.io/browser.php');
await page.fill('#text1', 'hello world!');
}