How to clear browser cache before every test run? I tried with driver.manage().deleteAllCookies();
in setUp
method after creating the driver instance, it is working for firefox, but for IE no use. Is there any solution for IE please provide me..
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
IE Browser clears the cache for each element after every page load
ieCapabilities.setCapability(InternetExplorerDriver.ENABLE_ELEMENT_CACHE_CLEANUP, true);
This will do session clean up:
ieCapabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With