Keep getting this exception at random intervals. For instance, the run will be okay now, but if i re run again in few mins I see the exception. Many have suggested to downgrade to selenium version 3.3.0 but i don't want to do that. Is there a workaround? I am currently using Selenium 3.14.0.
` public void ATestCase2() {
try
{
var category = driver.FindElement(By.Id("lRunMode"));
var selectElement = new SelectElement(category);
selectElement.SelectByValue("Pass");
var wait = new WebDriverWait(driver, new TimeSpan(0, 0, 30));
var SerachBy = driver.FindElement(By.Id("ddlSechBy"));
var SearchByPaidLoss = new SelectElement(SerachBy);
SearchByPaidLoss.SelectByValue("By Wim");
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.Id("tbxrchValue")));
IWebElement SerachTextBox = driver.FindElement(By.Id("tbxSearValue"));
SerachTextBox.Clear();
string claimNumber2 = "" + "ACs-01";
SerachTextBox.SendKeys(claimNumber2);
IWebElement GoButton = driver.FindElement(By.Id("btnndClaim"));
GoButton.Click();
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.AlertIsPresent());
// Switch the control of 'driver' to the Alert from main Window
IAlert simpleAlert = driver.SwitchTo().Alert();
// '.Text' is used to get the text from the Alert
String alertText = simpleAlert.Text;
Console.WriteLine("Alert text is " + alertText);
// '.Accept()' is used to accept the alert '(click on the Ok button)'
simpleAlert.Accept();
}
catch (Exception e)
{
Console.WriteLine(e.StackTrace);
}
}
`