select method
Triggers a change
and input
event once all the provided options have
been selected.
If there's no <select>
element matching selector
, the method throws an
error.
await page.select('select#colors', ['blue']); // single selection
await page
.select('select#colors', ['red', 'green', 'blue']); // multiple selections
Shortcut for Page.mainFrame.select
Parameters:
selector
: Aselector
to query page forvalues
: Values of options to select. If the<select>
has themultiple
attribute, all values are considered, otherwise only the first one is taken into account.
Returns an array of option values that have been successfully selected.
Implementation
Future<List<String>> select(String selector, List<String> values) {
return mainFrame.select(selector, values);
}