import unittest from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities class TestCase(unittest.TestCase): def setUp(self): capabilities = DesiredCapabilities.FIREFOX.copy() capabilities["moz:firefoxOptions"] = { "binary": "/Applications/FirefoxNightly.app/Contents/MacOS/firefox", "log": { "level": "info", }, } self.driver = webdriver.Firefox(capabilities=capabilities) self.addCleanup(self.driver.quit) def test_page(self): self.driver.get("http://seleniumhq.org/") if __name__ == '__main__': unittest.main()