User can enable Ie capabilities then clear cookies
DesiredCapabilities caps = DesiredCapabilities.internetExplorer(); caps.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true); WebDriver driver = new InternetExplorerDriver(caps);
driver.manage().deleteAllCookies()
If above one is not woking then U can go for Windows command level clearnace:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
Java : Runtime.getRuntime().exec("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2");
3 comments:
You're a KING!!!!!!
Hello!!
This works. But it works on my local machine. When I try to run this on remote machine(grid), it does not work. I get a following error:-
java.io.IOException: Cannot run program "C:\Windows\System32\rundll32.exe": error=2, No such file or directory
Please help.
Desired capabilities are more useful in clearing the browser cache. This one is nice post and People willing to get the indepth knowledge in getting framework such as TestNG,jenkins,Maven and POM should get properly get selenium training in chennai
Post a Comment