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