FirefoxProfile profile = new ProfilesIni().getProfile("default");
profile.setPreference("network.cookie.cookieBehavior", 2);
_driver = new FirefoxDriver(profile);
You would do similar in Chrome but not sure how to do it in Safari. Any help appreciated.
Thanks
SS
browser = webdriver.Safari()
browser.cleanSession = True
browser.ensureCleanSession = True
browser.delete_all_cookies()
def clearCache():
"""This will just delete the files straight from the safari folder, guarentee a clean start"""
try:
os.system("rm -rf $HOME/Library/Safari/LocalStorage/*.localstorage")
except Exception, e:
log.error("Error in clearCache: %s" %e)