I am running my Selenium tests with WebDriver. I am repeating the tests with some loop so now I want to Clear the cache before starting new test in JAVA.
@Te
Currently, there is no way to clear the cache through the web driver API. However, if you can start a new instance of the browser each time, the cache should be cleared in FF and Chrome because a new profile is created on each launch.
The comments for issue #40 (Clear cache) in the Selenium issue tracker list two potential solutions to your problem if creating a new browser instance isn't possible:
HTH
DT_IE_AGENT_ACTIVE=true activates the Add-On so that it collects data from the current browser session
Hope it help
I have used this lines of code in python to do that and it seems to clear the cache every time(Internet Explorer)
capab = DesiredCapabilities.INTERNETEXPLORER
capab.clear()