urlopen error [Errno 111] Connection refused for selenium python urlopen error [Errno 111] Connection refused for selenium python selenium selenium

urlopen error [Errno 111] Connection refused for selenium python


This is a temporary connectivity issue between your Selenium language bindings and a Selenium server. This may happen more often if you are using a remote Selenium server on a different machine and especially if it goes over the internet. We've, for instance, seen this kind of errors when using remote selenium servers at BrowserStack or Sauce Labs.

Since Python/Selenium bindings don't have an automatic way to retry JSON wire (JSON over HTTP) requests/commands, you are forced to handle it in your code. For instance, if these are tests you are executing - a common way to tackle these errors is to retry failed tests 3 times and, only if all 3 attempts fail - report a failed test.