I have updated IE Driver to 3.12.0.0 and it is not working. I get the below error message
Code:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
System.setProperty("webdriver.ie.driver", "C:\\iedriver\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver(cap);
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
Error Message from Console
Unable to create new remote session. desired capabilities = Capabilities [{ie.ensureCleanSession=true}], required capabilities = Capabilities [{}]
You were almost there. You need to use the method
merge()
method from MutableCapabilities Class to merge the DesiredCapabilities type of object into InternetExplorerOptions type object and initiate the WebDriver and WebClient instance by passing the InternetExplorerOptions object as follows :PS : As a reference you can have a look at the discussions in
mutablecapabilities
tag