How to clear browser cache before every test run? I tried with driver.manage().deleteAllCookies();
in setUp
method after creating the driver instan
Using java you can achieve that:
protected void deleteCookie(String cookieName) {
String cookieDomain = CTPropertiesManager.getProperty("site.properties", "site.cookie.domain");
try {
//get all cookies
Cookie cookies[] = request.getCookies();
Cookie ctCookie=null;
if (cookies !=null) {
for(int i=0; i
For deleting cache You can create one bat file which clear your browser or application cache before test start. after creating bat file just call in your code before test start.