How to clear browser cache before every test run? I tried with driver.manage().deleteAllCookies();
in setUp
method after creating the driver instan
There is a driver capability you can set as follows:
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
It worked for me on IE11.
Source: http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/ie/InternetExplorerDriver.html