简体   繁体   中英

is there a way to clear cache and cookies using javascript?

is there a way to clear cache and cookies using javascript? I am using selenium to run tests in microsoft edge and the tests run in the same session as the previous run (not a new session). Need to figure out how to run on a clean session each time. Right now, there does not seem to be any support in selenium for this.

To clear one cookie use this , to clear all cookies use this . You can't clear cache but you can append a version number like its mentioned on this

For Chrome and Firefox, I always used Watir's browser.cookies.clear http://www.rubydoc.info/gems/watir-webdriver/Watir/Cookies

However, I noticed that this did not work on Edge for some reason. So I'm waiting for an answer on this topic (might help you as well) https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14838528/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM