click method
Implementation
Future<Online> click(AbstractSelector selector,
{bool show = true, int index = 0}) async {
if (show) Show.clicking(selector.selector);
var selected = selector is XPath
? await (await page).waitForXPath(selector.selector, visible: true)
: await (await page).waitForSelector(selector.selector, visible: true);
if (selected != null) {
//if the element is not visible, scroll to it
await selected.click(delay: Duration(milliseconds: 100));
// await scroll_to(selector);
// await mouse_enter(selector);
// await mouse_over(selector);
// await Future.delayed(Duration(milliseconds: 100));
// await selected.click();
// await Future.delayed(Duration(milliseconds: 100));
}
return this;
}