Selenium python - Acess denied / hub / session when starting Firefox webdriver

I recently started using Selenium Webdriver (unlike Selenium 1.0), and I'm struggling with a problem that prevents me from running tests at all: when I try to run webdriver.Firefox (), I get a WebDriverException, see trace

An exception occurs when initializing the Firefox web browser:

driver = webdriver.Firefox() 

After some research (where I did not find messages about the same problem), I suspected that the company’s proxy server was to blame, and determined my own FirefoxProfile to configure the proxy server for webdriver, but that didn’t help either (tried both “without proxy” and manual proxy settings equal to the company standard). Also tried to add an exception for localhost / 127.0.0.1, which also did not help.

Has anyone encountered the same problem and hopefully solved it?

+4
source share
2 answers

So, after several days in a row, I ran into this problem: http://osdir.com/ml/selenium-users/2011-07/msg01149.html . Turns out it could be a permissions error. Try running python code as root user

Edit: Thanks Steve! "I got to the bottom of this. The problem is not directly related to permissions, but to an environment variable that could not be read when we ran it as root. We have the http_proxy environment variable, with no exceptions for the local one. This meant that the Python client was trying to connect to WebDriver through a proxy This was not a problem when starting as root because http_proxy was not installed.

This problem can be fixed by setting the no_proxy environment variable for the local host.

Hope this helps anyone who may be experiencing the same problem.

Steve " http://osdir.com/ml/selenium-users/2011-07/msg01169.html

+5
source

I met the same problem in Windows 7, after unchecking all the parameters associated with the proxy server in the "Internet Properties", there are no more errors

0
source

Source: https://habr.com/ru/post/1384122/


All Articles