How to clear browser cache automatically in Selenium WebDriver?

后端 未结 5 1318
别那么骄傲
别那么骄傲 2021-01-17 17:30

How to clear browser cache before every test run? I tried with driver.manage().deleteAllCookies(); in setUp method after creating the driver instan

5条回答
  •  执念已碎
    2021-01-17 18:10

    Use the below code to clear cache in IE

    try {
        Runtime.getRuntime().exec("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255");
    } catch (IOException e) {
        e.printStackTrace();
    }
    

提交回复
热议问题