Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium WebDriverException: Reached error page

I am following a Django TDD tutorial at:
http://www.marinamele.com/taskbuster-django-tutorial/taskbuster-working-environment-and-start-django-project
I get the following error when running 'all_users.py' before and after I start the development server 'python manage.py runserver':

Traceback (most recent call last): File "functional_tests/all_users.py", line 15, in test_it_worked self.browser.get('http://localhost:8000') File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 264, in get self.execute(Command.GET, {'url': url}) File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 252, in execute self.error_handler.check_response(response) File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Reached error page: >about:neterror?e=connectionFailure&u=http%3A//localhost%3A8000/&c=UTF->8&f=regular&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20s>erver%20at%20localhost%3A8000.

Basically the connection to localhost cannot be established.
The settings and configurations are identical to the tutorial in the previous link.

I have been struggling with the issue for two days, and would thank you most kindly if you could provide any help.

like image 425
SGAO Avatar asked May 05 '17 20:05

SGAO


4 Answers

I also followed the same tutorial and came across the same error. I noticed that I am not running the django server. The following is what helped.

python manage.py runserver
python functional_test.py
like image 133
scientific_explorer Avatar answered Oct 10 '22 16:10

scientific_explorer


I got the same error and what solved for me was changing from localhost to 127.0.0.1:

  • old: self.browser.get('http://localhost:8000')

  • better: self.browser.get('http://127.0.0.1:8000')

like image 7
Leandro M Avatar answered Oct 24 '22 11:10

Leandro M


I encountered the same problem, the final solution is: re-install again geckodriver

  1. Unzip the geckodriver.zip
  2. Move the file to /usr/bin directory sudo mv geckodriver /usr/bin
  3. Goto /usr/bin directory cd /usr/bin,then you would need to run something like sudo chmod a+x geckodriver to mark it executable.
like image 3
anjoy Avatar answered Oct 24 '22 11:10

anjoy


this might not be your situation, but I got the same error message when running a test (same book, hehe) without having anything actually listening on the targeted port (8000, in my case). Make sure there's something listening for a request by manually opening your browser and going to localhost:8000. In my case - silly me - I didn't have the server up at all =)

like image 3
alexakarpov Avatar answered Oct 24 '22 12:10

alexakarpov