title: Selenium: Clear chrome cache
body: <p>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).</p>
  
  <p>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. </p>
  
  <blockquote>
    <p>Configuration :</p>
    
    <p>Chrome Version: Version 65.0.3325.181 (Official Build) (64-bit)</p>
    
    <p>Selenium Version: 3.11.0</p>
  </blockquote>
  
  <pre><code>//Clear the cache for the ChromeDriver instance.
  driver.get("chrome://settings/clearBrowserData");
  Thread.sleep(10000);
  driver.findElement(By.xpath("//*[@id='clearBrowsingDataConfirm']")).click();
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UR8vE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UR8vE.png" alt="enter image description here"></a></p>