Selenium error: No response from server for url http://localhost:7055

后端 未结 3 1354
野趣味
野趣味 2020-12-16 14:25

I\'m using Selenium, C#, NUnit to write tests, sometimes I getting below error:-

OpenQA.Selenium.WebDriverException : No response from server for url htt

相关标签:
3条回答
  • 2020-12-16 14:58

    Are you using IE? I was getting this until I discovered that I could set the base URL through config on the object. Otherwise, the first page it takes you to is something generated by Selenium, and it seems to miss the cues for the "real" request.

     var options = new InternetExplorerOptions()
     {
         InitialBrowserUrl = _baseUrl,
         IntroduceInstabilityByIgnoringProtectedModeSettings = true
     };
    
     _driver = new InternetExplorerDriver(_ieDriverServerPath, options);
    

    I use that in a TextFixtureSetup method in my tests.

    0 讨论(0)
  • 2020-12-16 15:06

    Found Following workarounds here:

    https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/1im-LurjK5s

    http://watirmelon.com/2011/10/04/c-avoiding-the-webdriverexception-no-response-from-server-for-url/

    0 讨论(0)
  • 2020-12-16 15:06

    I had the same problem and solve in this way:

    a) avoid methods like 'do wity retry' to manipulate IWebElements, because in this way the tests take to many time to run, is unnecessary and tests fails intermittently.

    b) downgrade the Firefox version to 5 (maybe from FF 3.6 until 6 works fine, but the new versions of FF throws an intermittent exception like 'No response from hub/session...'

    c) if you need to handle elements in your test that is loaded via Ajax on page, be sure to provide a js function that you can stop element load, so you should call this function from WebDdriver before FindElement and do what you want.

    0 讨论(0)
提交回复
热议问题