Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97806

Selenium: Clear chrome cache

$
0
0

In my application I need a way to clear only the cache of the chrome browser before log out (except cookies - I do not want to delete cookies).

Can any one suggest me a way to click on the CLEAR DATA button in chrome. I have written the below code but the code is not working.

Configuration :

Chrome Version: Version 65.0.3325.181 (Official Build) (64-bit)

Selenium Version: 3.11.0

//Clear the cache for the ChromeDriver instance.
driver.get("chrome://settings/clearBrowserData");
Thread.sleep(10000);
driver.findElement(By.xpath("//*[@id='clearBrowsingDataConfirm']")).click();

enter image description here


Viewing all articles
Browse latest Browse all 97806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>