Alex Bruce
Alex Bruce

Reputation: 553

selenium Unable to find elements on closed window when navigate to other page on IE11

System.setProperty("webdriver.ie.driver", System.getProperty("user.dir") + "/Driver/IEDriverServer.exe");
Map<String, By> objectMap = DataHelper.getObjectMap();
WebDriver driver = new InternetExplorerDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("XXXXX");
driver.findElement(objectMap.get("processworld_username")).clear();
driver.findElement(objectMap.get("processworld_username")).sendKeys("XXX");
driver.findElement(objectMap.get("processworld_password")).clear();
driver.findElement(objectMap.get("processworld_password")).sendKeys("XXX");
driver.findElement(objectMap.get("processworld_sign_in_btn")).click();
driver.findElement(objectMap.get("patt_createproject_link")).click();

org.openqa.selenium.NoSuchWindowException: Unable to find elements on closed window (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 10 milliseconds Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52' System info: host: 'PHMNL1-SQLXiAn', ip: '10.164.228.143', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://patttest.emersonprocess.com/main.asp?url=, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}] Session ID: 9a00ac20-b304-4ba5-9667-149392ceedc5 *** Element info: {Using=partial link text, value=Create Project} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)

After processworld_sign_in_btn is clicked, the page will navigate to a new page, then the error appears, I've tried to set the protected mode for all zones , but it not work for me

Upvotes: 0

Views: 4728

Answers (1)

Aniruddhya
Aniruddhya

Reputation: 38

I also faced the same issue once. It was solved with a simple registry update. I hope that this solution helps you -

You need to check a key in the registry editor - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

In 64 bit system, you can find the same key in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

The sub key FEATURE_BFCACHE may or may not be present. You have to create it if it is not present. Inside this key, create a DWORD value and name it iexplore.exe with the value 0.

Upvotes: 1

Related Questions