I'm clicking an element and the button clicked opens another window. unfortunately , after a preiod of time , nothing happens and the script hangs with HTTP timeout error.
public static void ClickJavaScriptButton(string Element,IWebDriver Webdriver)
{
IWebElement element = Webdriver.FindElement(By.Id(Element));
IJavaScriptExecutor executor = (IJavaScriptExecutor)Webdriver;
executor.ExecuteScript("arguments[0].click();", element);
}
EDIT: Already tried the following option.
Webdriver.FindElement(By.Id(Element)).Click()