for one of my scripts, I need to restart a browser (chromeDriver) session at some random point.
I have tried to restart the webdriver in a test script without success.
def start_browser():
driver.get('https://www.google.com/')
time.sleep(1)
def close():
driver.quit()
driver.get("http://www.google.com/")
for x in range (1,5):
start_browser()
time.sleep(5)
close()
time.sleep(5)
For some reason, the script does not start a new instance of the browser, instead it crashes. I think I am missing out some vital selenium command, but I could not find anything on the official page.