String executable = PathUtils.normalize(driverOptions.get(IEDRIVER));
if (!new File(executable).canExecute())
throw new IllegalArgumentException("Missing IEDriverServer: " + executable);
System.setProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY, executable);
}
InternetExplorerDriverService service = new InternetExplorerDriverService.Builder()
.usingAnyFreePort()
.withEnvironment(driverOptions.getEnvVars())
.build();
caps.merge(driverOptions.getCapabilities());
InternetExplorerDriver driver = new InternetExplorerDriver(service, caps);