def test_firefox(): driver = webdriver.Firefox(executable_path="/usr/local/bin/geckodriver") driver.get("http://localhost") driver.quit()
from selenium import webdriver
test_firefox()
When attempting to run a Selenium test using Firefox as the browser, the test fails to start the driver service on http://localhost . This issue prevents the test from executing successfully. def test_firefox(): driver = webdriver
public class FirefoxTest { public static void main(String[] args) { System.setProperty("webdriver.gecko.driver", "/usr/local/bin/geckodriver"); WebDriver driver = new FirefoxDriver(); driver.get("http://localhost"); driver.quit(); } } WebDriver driver = new FirefoxDriver()