1

I am following this tutorial to learn more about Test-Driven Development with Django but have hit a snag.

In tutorial we are asked to use the following code which, when run, opens up my Firefox browser and dircts to the URL (http://localhost:8000).

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://localhost:8000')

assert 'Django' in browser.title

When run (using PyCharm), the browser opens with no issue but does not direct to the URL and the address bar remains blank. If I manually type in the URL it shows what should appear.

After some searching the only real results I found were that there were compatibility issues but after updating everything I am still encountering the error.

Does anyone have any suggestions as to resources to help solve the issue or maybe know a solution?

Thank you for your time.

4
  • 1
    Is there a server at localhost:8000? What happens if you use something like http://stackoverflow.com instead? Commented Jan 9, 2019 at 6:08
  • @mblakesley I receive the same result. It opens up firefox with an orange address bar saying "search or enter address". If I type localhost:8000 it comes up with the default Django page. Commented Jan 9, 2019 at 6:12
  • 1
    You're running PyCharm under a different environemnt? Commented Jan 9, 2019 at 6:18
  • @kerwei thank you for the comment. I just tried running it through terminal (Ubuntu) using my virtual environment and ended at the same result. Commented Jan 9, 2019 at 6:21

1 Answer 1

1

it usually happen because you have incompatible version between Firefox and geckodriver, update both software, for latest geckodriver you can get it here.

Sign up to request clarification or add additional context in comments.

3 Comments

So I tried updating both software but now when I run it I get the error "Your Firefox profile cannot be loaded. It may be missing or inaccessible." I created a new profile and still receive the same error.
there many possibilities but you can try to find the answer here
I do not but I believe your solution is correct. I will be working on it again today. Thank you for your time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.