I\'m using Selenium, C#, NUnit to write tests, sometimes I getting below error:-
OpenQA.Selenium.WebDriverException : No response from server for url htt
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.
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/
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
.