Could you please help me with the next. I found out the issue and could not resolve it. When I am using next code, the browser has started and the test has passed:
I'm not sure as I haven't tested it but I suspect the browser is still opened from the first code. So what I suggest here is to use driver.close() to terminate the process properly once you get out of script.
import unittest
from selenium import webdriver
driver = webdriver.Chrome('D:\chromedriver\chromedriver.exe')
driver.get("site URL")
driver.close() # Must be there
Similarly, you can make modification in the test script to put self.driver.close() in the tearDown method.