Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win10 64bit and IE11 throws NoSuchWindowException: Error retrieving current window #4610

Closed
shankarkc opened this issue Aug 31, 2017 · 18 comments
Labels

Comments

@shankarkc
Copy link

Meta -

OS:

Windows10
Selenium Version:
3.4.0

Browser: Internet Explorer v11

Browser Version: 11.540.15063.0 (64 bit)

Expected Behavior -

Windows should not throw exception

Actual Behavior -

windows throws exception
NoSuchWindowException: Error retrieving current window

On node i see this call stack

org.openqa.selenium.NoSuchWindowException: Error retrieving current window
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WIN10NODE', ip: '10.169.55.23', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(manual, http=10.163.3.125:443, ssl=10.163.3.125:443), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={browserAttachTimeout=0.0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0.0, ie.browserCommandLineSwitches=, requireWindowFocus=false, initialBrowserUrl=http://localhost:37071/, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: 1da734e8-c3de-4299-a886-f2ec00503672
	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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.setSize(RemoteWebDriver.java:890)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.setSize(EventFiringWebDriver.java:625)
	at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:53)
	at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:27)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
09:47:40.480 WARN - Exception: Error retrieving current window
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WIN10NODE', ip: '10.169.55.23', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(manual, http=MyProxyIPHere:443, ssl=MyProxyIPHere:443), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={browserAttachTimeout=0.0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0.0, ie.browserCommandLineSwitches=, requireWindowFocus=false, initialBrowserUrl=http://localhost:37071/, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: 1da734e8-c3de-4299-a886-f2ec00503672

I have configured IE as mentioned here

Steps to reproduce -

On windows10 64bit machine with IE11 installed.....configure IE as mentioned here
Use IE driver iedriver_3.5.1_x64bit for selenium grid.

Here is the code that throws exception

		webDriver.get(url);
		// setting browser window size
		webDriver.manage().window().setSize(new Dimension(1600,900));
@jimevans
Copy link
Member

If you've configured IE properly, why are you using the INTRODUCE_FLAKINESS... setting? Also, there is usually no reason to use the 64-bit IE driver for IE10 or later.

@barancev barancev added the D-IE label Aug 31, 2017
@barancev
Copy link
Member

  1. Make sure you can reproduce the issue with 32-bit driver and without ignoreProtectedModeSettings capability.

  2. Please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@shankarkc
Copy link
Author

Thanks @jimevans / @barancev i will try your suggestions and update.
Thanks for hints

@shankarkc
Copy link
Author

@jimevans / @barancev as you guys suggested i tried with

  • win32bit webdriver
  • removed INTRODUCE_FLAKINESS
  • removed ignoreProtectedModeSettings settings from DesiredCapabilities class

But I sill see the same behavior

At client i see this call stack

org.openqa.selenium.NoSuchWindowException: Error retrieving current window
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WIN10NODE', ip: 'YourNodeIPHere', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(manual, http=YourProxyIPHere:443, ssl=YourProxyIPHere:443), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={browserAttachTimeout=0.0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0.0, ie.browserCommandLineSwitches=, requireWindowFocus=false, initialBrowserUrl=http://localhost:3347/, ignoreProtectedModeSettings=false}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: b7bbc3d0-602e-4ac5-8b9c-6ddc7063ba49
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'inll11306565l', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-91-generic', java.version: '1.8.0_144'
Driver info: driver.version: RemoteWebDriver

I see exception on node. I do see window popsup on node when session get created but below cod fails

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("nativeEvents", false);
caps.setBrowserName(BrowserType.IE);
caps.setCapability("acceptInsecureCerts", false);
WebDriver webDriver = new RemoteWebDriver(new URL(hubUrl), caps);
webDriver.get("MyWebsiteURLHere");
webDriver.manage().window().setSize(new Dimension(1600,900));

Here is exception

org.openqa.selenium.NoSuchWindowException: Error retrieving current window
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WIN10NODE', ip: 'YourNodeIPHere', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(manual, http=YourProxyIPHere:443, ssl=YourProxyIPHere:443), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={browserAttachTimeout=0.0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0.0, ie.browserCommandLineSwitches=, requireWindowFocus=false, initialBrowserUrl=http://localhost:3347/, ignoreProtectedModeSettings=false}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: b7bbc3d0-602e-4ac5-8b9c-6ddc7063ba49
	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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.setSize(RemoteWebDriver.java:890)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.setSize(EventFiringWebDriver.java:625)
	at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:53)
	at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:27)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
05:11:45.210 WARN - Exception: Error retrieving current window
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WIN10NODE', ip: 'YourNodeIPHere', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(manual, http=YourProxyIPHere:443, ssl=YourProxyIPHere:443), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={browserAttachTimeout=0.0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0.0, ie.browserCommandLineSwitches=, requireWindowFocus=false, initialBrowserUrl=http://localhost:3347/, ignoreProtectedModeSettings=false}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: b7bbc3d0-602e-4ac5-8b9c-6ddc7063ba49

I tested with below 2 registry entries on Win10 registry (one after another)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE]
"iexplore.exe"=dword:00000000
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE]
"iexplore.exe"=dword:00000000

But it didnt help

Please let me know if this is a defect OR i missed something.

@barancev
Copy link
Member

barancev commented Sep 1, 2017

Start remote server that starts IE with extra options to collect IE driver logs:

java -Dwebdriver.ie.driver.logfile=iedriver.log -Dwebdriver.ie.driver.loglevel=TRACE -jar selenium-server-standalone.jar

run your scenario and attach the collected log file here.

@shankarkc
Copy link
Author

here is the trace log content

T 2017-09-05 11:07:33:879 server.cc(183) Process request with: URI: /session/09398a8e-07f7-4abe-9379-28678a65adc5/window/rect HTTP verb: POST
body: {"width":1600,"height":900}
T 2017-09-05 11:07:33:879 server.cc(272) Entering Server::DispatchCommand
T 2017-09-05 11:07:33:879 server.cc(583) Entering Server::LookupCommand
D 2017-09-05 11:07:33:879 server.cc(281) Command: POST /session/09398a8e-07f7-4abe-9379-28678a65adc5/window/rect {"width":1600,"height":900}
T 2017-09-05 11:07:33:879 server.cc(378) Entering Server::LookupSession
T 2017-09-05 11:07:33:879 IESession.cpp(191) Entering IESession::ExecuteCommand
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(122) Entering IECommandExecutor::OnSetCommand
T 2017-09-05 11:07:33:879 command.cc(31) Entering Command::Deserialize
D 2017-09-05 11:07:33:879 command.cc(36) Raw JSON command: { "name" : "setWindowRect", "locator" : { "sessionid" : "09398a8e-07f7-4abe-9379-28678a65adc5" }, "parameters" : {"width":1600,"height":900} }
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(133) Entering IECommandExecutor::OnExecCommand
T 2017-09-05 11:07:33:879 IESession.cpp(212) Beginning wait for response length to be not zero
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(454) Entering IECommandExecutor::DispatchCommand
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(567) Entering IECommandExecutor::GetCurrentBrowser
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(573) Entering IECommandExecutor::GetManagedBrowser
W 2017-09-05 11:07:33:879 IECommandExecutor.cpp(581) Browser ID requested was an empty string
W 2017-09-05 11:07:33:879 IECommandExecutor.cpp(497) Unable to find current browser
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(567) Entering IECommandExecutor::GetCurrentBrowser
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(573) Entering IECommandExecutor::GetManagedBrowser
W 2017-09-05 11:07:33:879 IECommandExecutor.cpp(581) Browser ID requested was an empty string
T 2017-09-05 11:07:33:879 response.cc(85) Entering Response::SetErrorResponse
T 2017-09-05 11:07:33:879 response.cc(78) Entering Response::SetResponse
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(567) Entering IECommandExecutor::GetCurrentBrowser
T 2017-09-05 11:07:33:879 IECommandExecutor.cpp(573) Entering IECommandExecutor::GetManagedBrowser
W 2017-09-05 11:07:33:879 IECommandExecutor.cpp(581) Browser ID requested was an empty string
W 2017-09-05 11:07:33:879 IECommandExecutor.cpp(514) Unable to get current browser
T 2017-09-05 11:07:33:879 response.cc(51) Entering Response::Serialize
T 2017-09-05 11:07:33:898 IESession.cpp(221) Found non-zero response length
T 2017-09-05 11:07:33:898 IECommandExecutor.cpp(156) Entering IECommandExecutor::OnGetResponse
T 2017-09-05 11:07:33:898 IECommandExecutor.cpp(285) Entering IECommandExecutor::OnIsSessionValid
D 2017-09-05 11:07:33:898 server.cc(338) Response: {"value":{"data":null,"error":"no such window","message":"Error retrieving current window","stacktrace":""}}

I am also attaching full log file for your reference.

log file

@shankarkc
Copy link
Author

Hi did the callstack help? Why its failing on Win10 & IE11? Are there any workaounds?

@shankarkc
Copy link
Author

@barancev did attached logfile help to find root cause? Please let me know if you need more details.

@jimevans
Copy link
Member

@shankarkc Please provide the full log, not just the portion of it.

@shankarkc
Copy link
Author

My bad. Sorry @jimevans / @barancev ...Attaching the log file.

iedriver.txt

Thanks
Shankar KC

@sarthak2990
Copy link

Is their any fix/solution for this?

@TychonautVII
Copy link

I'm running into a similar issue after applying all the required configuration for IE11, including the registry entry, and trying the methods mentioned here

@sharmsa66
Copy link

I am also having same issue. Please advise.

@jimevans
Copy link
Member

jimevans commented Feb 9, 2019

There has yet to be a trace log added with a version of IEDriverServer.exe later than 3.5, which would be required to diagnose the issue any further. Anyone asking “is there any other fix,” or “please advise” will need to provide that information first.

@TychonautVII
Copy link

TychonautVII commented Feb 10, 2019

@jimevans that makes sense! See attached. I'm on windows 10 64bit with IE 11, and have followed the directions in the required config section of the wiki

ie_service.log

Looking at this a bit myself, it looks like I pass a "protected values settings valid" check, but then get the error

"This instance of Internet Explorer is exiting without an explicit request to close it. Unless you clicked a link that specifically attempts to close the page, that likely means a Protected Mode boundary has been crossed (either entering or exiting Protected Mode). It is highly likely that any subsequent commands to this driver instance will fail. THIS IS NOT A BUG IN THE IE DRIVER! Fix your code and/or browser configuration so that a Protected Mode boundary is not crossed."

Looking at my protected mode settings in the GUI they all look good.

I've also tried the 32 bit version which didn't help.

ie_service_32.log

@jimevans
Copy link
Member

jimevans commented Feb 10, 2019

@TychonautVII Looking at the logs you posted, the root cause of your issue is that you’re attempting to navigate to a file:// URL on your local machine. Local file URLs are parsed into a Protected Mode zone that does not appear in the Internet Explorer UI. What happens when you host the page you’re automating on an actual web server and attempt to automate IE with that?

Aside: While other browsers may handle those URLs without issue, that’s immaterial to IE. The driver really can’t do anything about it, so issues saying “I can’t use local-file-based URLs with the IE driver” will simply be closed.

@TychonautVII
Copy link

TychonautVII commented Feb 10, 2019

Thanks for taking a look at my logs @jimevans!

If I actually host my files on a local server, this does seem to work.

In my application, these HTML files are actually delivered as files meant to be open by the clients and used in the browser on their computer without a server. They still have JavaScript content though. Serving the files locally makes my tests less like what my users will actually see, but this is a better work around than I had before, which was basically drop Selenium and switch to JavaScript based testing haha.

Is there any way to get this other protected mode zone aligned with the other 4?

Also I totally get that there might be nothing that can be done on this given how IE works, and my application might be a little fringe. However even so, I think spelling this out is worth a paragraph in the IE Explorer Driver wiki, maybe in the required configuration section. It might be worth adding it to an initialization check or the protect mode check or somewhere else in the code / logs. That would probably save some people some heartache, particularly given that I think the people most likely to be trying to test local files are people playing around trying to get this to work for the first time.

@barancev
Copy link
Member

Sorry for leaving this issue unanswered. As @jimevans said IE handles file:// protocol in a different mode and we have no plans to improve support for this mode in Selenium. So we'll close this issue.

But you can try to get help of the community, maybe someone knows how to tune IE properly to better handle this protocol:

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants