0

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. enter image description here

enter image description here

` 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);
        }
    }

`

Heike
  • 149
  • 1
  • 1
  • 11
  • That's a stack trace... where is the error message? Please read why [a screenshot of code is a bad idea](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). Paste the code and properly format it instead. – JeffC Feb 08 '19 at 22:55
  • @Heikegani Does this [discussion](https://stackoverflow.com/questions/43696314/issue-creating-remotewebdriver-instance-in-c-sharp-and-specflow/43696435#43696435) helps you? – undetected Selenium Feb 09 '19 at 13:37

0 Answers0