set_secret method

Future<Online> set_secret(
  1. AbstractSelector selector,
  2. String text, {
  3. Duration? timeout = null,
  4. int index = 0,
})

Implementation

Future<Online> set_secret(AbstractSelector selector, String text,
    {Duration? timeout = null, int index = 0}) async {
  Show.setting(selector.selector, text, secret: true);
  if (selector is XPath) {
    var selected = await (await page).waitForXPath(selector.selector);
    if (selected != null) {
      await selected.evaluateHandle('''(element, text) => {
        element.value = text;
      }''', args: [text]);
    }
  } else {
    var selected = await (await page).waitForSelector(selector.selector);
    if (selected != null) {
      await selected.evaluateHandle('''(element, text) => {
        element.value = text;
      }''', args: [text]);
    }
  }
  return this;
}