selectOption(values, [options])
Warning
Use
locator.selectOption(values[, options])
instead.
Select one or more options which match the values.
Returns
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('https://test.k6.io/browser.php');
const options = await page.$('#numbers-options');
await options.selectOption('three');
await page.close();
}