set_attribute method

Future<Online> set_attribute(
  1. AbstractSelector selector,
  2. String attribute,
  3. String value
)

Implementation

Future<Online> set_attribute(
    AbstractSelector selector, String attribute, String value) async {
  Show.action('setting', attribute, 'to', value, selector.selector);
  await (await page).waitForSelector(selector.selector);
  await (await page).evaluate('''(selector, attribute, value) => {
    document.querySelector(selector).setAttribute(attribute, value);
  }''', args: [selector.selector, attribute, value]);
  return this;
}