In selenium you can only delete cookies on the current domain, but would it be possible to navigate to the file where Firefox is storing the cookies and either delete the file or overwrite it? I've been looking around, but can't find where selenium stores the cookies.
Navigate to the Chrome settings page with Selenium by executing the driver. get('chrome://settings/clearBrowserData') . Click on the Clear Data button to clear the cache.
Selenium does not provide a way to delete cache, here are some workarounds. There are a few ways in which cache can be deleted using Selenium Webdriver for regular Chrome browsers. For instance, here they explain how selenium can be used to clear cache like a real user i.e., by navigating to chrome settings.
Selenium WebDriver provides multiple commands for handling the cookies in a website. These Selenium cookies APIs provide you the required mechanism for interacting and querying the cookies.
You can specify a user directory and then manipulate <userdir>/Default/Cookies
. This question is similar: Getting or Manipulating all cookies in Selenium Webdriver
Selenium doesn't store the cookies, the browser does. So the answer to "where [the browser] stores the cookies" will be different for each browser. But since Selenium always starts the browser with a clean profile, you shouldn't have to do this - there are no cookies when the browser starts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With