Selenium WebDriver: Firefox starts, but does not open the URL Selenium WebDriver: Firefox starts, but does not open the URL python python

Selenium WebDriver: Firefox starts, but does not open the URL


Ok, after searching around for a while I noticed that usually the problem was a bug in Selenium (possible, but rather unlikely), or a proxy issue.Still, none of the answers suggesting how to solve the proxy issue seemed to work.

Finally I got it: you need to unset all proxy settings everywhere (environment variables, and - in my case this was the issue- on Gnome). Later when you create the webdriver, you need to pass a profile which sets the browser proxy settings to what you actually use (in my case an automatic config url)

1) Unset the http_proxy environment variable (which is used by urllib)

export http_proxy=

2) Cleared Gnome proxy settings:System --> Preferences --> Network Proxy --> Select "Direct Internet Connection"

3) Started webdriver.Firefox() with a profile which configures the proxy (in this case it's an automatic proxy configuration)

fp = webdriver.FirefoxProfile()# Here "2" stands for "Automatic Proxy Configuration"fp.set_preference("network.proxy.type", 2)fp.set_preference("network.proxy.autoconfig_url",                  "http://proxy-address-here:8080/") driver = webdriver.Firefox(firefox_profile=fp)


Needs to upgrade the selenium, If you are using Latest version of Firefox, you should use latest version of selenium

For Python, Enter this command

pip install -U selenium

For Java, Remove the old jar and Download Latest Version from here http://www.seleniumhq.org/download/ and Attach into build path. It will work find . Happy Testing with Firefox


Please also try turning off your localhost(127.0.0.1) web server if you have any running on the usual port 80.

The Firefox Binary does not allow you to load the profile if there is a localhost server running.

See line 81 in selenium\webdriver\firefox\firefox_binary.py which points to the function / method is_connectable(self)

def is_connectable(self):    """Trys to connect to the extension but do not retrieve context."""    try:        socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)        socket_.settimeout(1)        socket_.connect(("127.0.0.1", self.profile.port))        socket_.close()        return True    except socket.error:        return False

GLHF