Can't Get Browsers To Close At The End Of Automation Script
<p>I've been struggling with this for a while.  So I'm using parametrize in pytest for cross browser testing written in Python.  I was able to start up all 3 instances but at the end of the test only the Chrome instance closes but Safari and Firefox stay open.  This is my script:</p>

<pre><code>@pytest.mark.parametrize("browser", [
   ("chrome"),
   ("firefox"),
   ("safari")]
)
def test_eval(browser):
    print browser

    if browser == "chrome":
        driver = webdriver.Chrome()
    elif browser == "firefox":
        caps = DesiredCapabilities.FIREFOX
        caps["marionette"] = True
        caps["binary"] = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
        driver = webdriver.Firefox(capabilities=caps)
    elif browser == "safari":
        os.environ["SELENIUM_SERVER_JAR"] = "selenium-server-standalone-3.0.0-beta2.jar"
        driver = webdriver.Safari()

    driver.get("https://www.google.com")

    driver.quit()
</code></pre>

<p>Thanks in advance for the help!</p>

<p>This may help, <a href="http://stackoverflow.com/questions/15067107/difference-between-webdriver-dispose-close-and-quit">Difference between webdriver.Dispose(), .Close() and .Quit()</a></p>

<p>They suggest to use driver.close() for ones that arent chrome</p>

python selenium-webdriver py.test