Reputation: 2703
Hello to all,
I use Selenium with all sorts of drivers, but today when I used the IEDriver for the first time I got the exception: "Error retrieving window with handle current"
My code is:
private static IWebDriver driver;
InternetExplorerDriverService driverService = InternetExplorerDriverService.CreateDefaultService();
InternetExplorerOptions IEOptions = new InternetExplorerOptions();
driverService.HideCommandPromptWindow = true;
driverService.LibraryExtractionPath = Environment.CurrentDirectory;
driverService.Port = 8080;
IEOptions.EnableNativeEvents = true;
IEOptions.IgnoreZoomLevel = true;
IEOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
driver = new InternetExplorerDriver(driverService, IEOptions, TimeSpan.FromSeconds(120));
js = driver as IJavaScriptExecutor;
wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeToWait));
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(ImplicitlyWaitTime));
driver.Navigate().GoToUrl("something");
driver.Manage().Window.Maximize(); //*
It loads the website and when I call Maximize the program throws an exception (after that I can't do anything with that driver object [window handler lost])
This happens only with the IE Driver (I tried the 32 and 64 bit versions).
I am using the latest version of Selenium.
Thanks.
Upvotes: 2
Views: 2427
Reputation: 3889
For I.E. it needs to be configured correctly. Ensure you have followed the instructions correctly for I.E. to work. It needs more setup than the other browsers I.E. Selenium Configuration
Upvotes: 1