To set the custom path to Firefox you need to use FirefoxBinary:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary('F:\FirefoxPortable\Firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)
Or else, add F:\FirefoxPortable to the path environment variable and fire up Firefox in a traditional way:
driver = webdriver.Firefox()
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s automation testing certification!