4

I have simple Selenium xUnit Test as below

    [Fact]
    public void Test()
    {
        var driver = new InternetExplorerDriver(@"C:\Users\myusername\.nuget\packages\selenium.webdriver.iedriver\3.150.1\driver");

        driver.Navigate().GoToUrl("http://www.google.com");

        var q = driver.FindElementByName("q");
        q.SendKeys("Stackoverflow");
    }

When i run test. it opens IE11 browser, goes to url, in this case it goes to www.google.com and thats it.
After navigating to the URL it does not execute the next line of code, which is var q = driver.FindElementByName("q");

and after 60 seconds it throws error

OpenQA.Selenium.WebDriverException: 'The HTTP request to the remote WebDriver server for URL http://localhost:64515/session/4240d446-303f-40b4-b25e-6d7161b2ac73/url timed out after 60 seconds.'

LP13
  • 30,567
  • 53
  • 217
  • 400

1 Answers1

0

Try to put a "Wait" command before the "FindElementByName", there is a chance that this line is executed before the element is shown.

Ariel
  • 165
  • 1
  • 3
  • 15
  • As i said the next statement afetr `Goto()` does not get executed. So putting `wait` after `Goto()` would not help barbecue it never executes. ( I tried btw with no luck) – LP13 Nov 19 '19 at 15:39