How to clear browser cache while running Selenium tests with JUnit on LambdaTest cloud?
Hi Richard,
In order to clear browser cache after performing JUnit testing using Selenium on LambdaTest cloud, you can use the below code snippet:
// Clearing browser Cache after Test
driver.manage().deleteAllCookies(); // delete all cookies
Thread.sleep(7000); // wait 7 seconds to clear cookies.
Here’s the GitHub repo for the same: GitHub - Bhakti-satalkar/junit-selenium-browser-cache-clear: Clear browser cache by running Selenium tests with JUnit on LambdaTest cloud.