DougM
DougM

Reputation: 940

Using selenium script to test URL but after browser opens, it does not point to the requested URL

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.

Upvotes: 1

Views: 143

Answers (1)

ewwink
ewwink

Reputation: 19164

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

Upvotes: 1

Related Questions