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

I am unable to locate any elements on any page in IE11 Windows 10 with IEDriver #3611

Closed
simonlebonbon opened this Issue Mar 6, 2017 · 11 comments

Comments

Projects
None yet
8 participants
@simonlebonbon

simonlebonbon commented Mar 6, 2017

OS:
Windows 10
Selenium Version:
3.2.0 (but can use any)
Browser:
IE11
Browser Version:
11.576.14393.0 can use 32 or 64 bit version

Posted this on Stack Overflow but thought better placed here..

I've searched all over for an answer and I can't find any fix to my issue. I am trying to run my Selenium tests in IE11. All other browsers work fine (including Edge). A simple test as follows will cause the issue...

System.setProperty("webdriver.ie.driver.loglevel","TRACE");
System.setProperty("webdriver.ie.driver.logfile", "C:/Projects/logme.txt");
driver = new InternetExplorerDriver();
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.get("http://www.google.com");
driver.findElement(By.id("lst-ib")).click;

IE11 will launch and navigate to a URL but it cannot find any elements anywhere on any page. Again, I'm aware people have had this issue but no suggestions have fixed my problem. This is the error i get back every time:

org.openqa.selenium.NoSuchElementException: Unable to find element with id == lst-ib (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.23 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000'System info: host: 'DESKTOP-63BRP93', ip: '10.0.110.68', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriverCapabilities [{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://localhost:38992/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 0fbcebc8-6775-4a6c-b10a-47350502598f
*** Element info: {Using=id, value=lst-ib}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

Here is what I've tried/done...

  1. Set Enabled Protected Mode to disabled and enabled for all zones
  2. Set Allow Scripting option on the advanced tab or IE options
  3. Tried every IEDriver capability known to man e.g. setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,true);
  4. Tried IE11 32 and 64bit
  5. Attempted to find an element by, class, tagname and all the rest of the locators to no avail.
  6. Added the 2 registry keys BFCACHE for both 32 and 64bit instances of IE
  7. Cried a lot

Below is the attached logs and I've located where the code falls over. It seems to be security related but JavaScript is enabled and I don't know where else to look...

T 2017-03-06 17:27:41:529 Browser.cpp(613) Entering Browser::GetDocumentFromWindow
T 2017-03-06 17:27:41:532 Script.cpp(49) Entering Script::Initialize
T 2017-03-06 17:27:41:532 Script.cpp(70) Entering Script::AddArgument(std::wstring)
T 2017-03-06 17:27:41:532 Script.cpp(105) Entering Script::AddArgument(VARIANT)
T 2017-03-06 17:27:41:532 Script.cpp(70) Entering Script::AddArgument(std::wstring)
T 2017-03-06 17:27:41:532 Script.cpp(105) Entering Script::AddArgument(VARIANT)
T 2017-03-06 17:27:41:532 Script.cpp(169) Entering Script::Execute
T 2017-03-06 17:27:41:532 Script.cpp(477) Entering Script::CreateAnonymousFunction
W 2017-03-06 17:27:41:539 Script.cpp(494) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failed
W 2017-03-06 17:27:41:540 Script.cpp(180) Cannot create anonymous function
W 2017-03-06 17:27:41:540 ElementFinder.cpp(98) A JavaScript error was encountered executing the findElement atom.

If anyone has seen or fixed this issue, please help me!

Thanks

@krmahadevan

This comment has been minimized.

Show comment
Hide comment
@krmahadevan

krmahadevan Mar 12, 2017

Contributor

@simonlebonbon - Although I found many posts that all hint at Javascript disabled as the possible reasons, this post by @jimevans (Maintainer, Selenium Project Internet Explorer Driver) on the Selenium users google forums seemed most relevant to your problem. So I would request you to please help take a look at the post and also at the issues that Jim has called out in that post and see if your issue has anything to do with KB3025390 (which is what is causing the problem).

Here are the links to all the issues that Jim has called out in his post

The last comment on the above mentioned google forums thread reads as below

I was able to solve the problem by lowering the the security level in "Internet Options" in the Internet zone from "High" to "Medium-high" or "Medium". (IE11, win10)

So you could first try this before delving into the other details that are mentioned in the thread.

Contributor

krmahadevan commented Mar 12, 2017

@simonlebonbon - Although I found many posts that all hint at Javascript disabled as the possible reasons, this post by @jimevans (Maintainer, Selenium Project Internet Explorer Driver) on the Selenium users google forums seemed most relevant to your problem. So I would request you to please help take a look at the post and also at the issues that Jim has called out in that post and see if your issue has anything to do with KB3025390 (which is what is causing the problem).

Here are the links to all the issues that Jim has called out in his post

The last comment on the above mentioned google forums thread reads as below

I was able to solve the problem by lowering the the security level in "Internet Options" in the Internet zone from "High" to "Medium-high" or "Medium". (IE11, win10)

So you could first try this before delving into the other details that are mentioned in the thread.

@wilx

This comment has been minimized.

Show comment
Hide comment
@wilx

wilx Apr 24, 2017

I am seeing this as well. My Windows 10 is 10.0.14393, IE is 11.447.14393.0, Selenium 3.3.1 with IEDriverServer 3.3.0 64bit.

T 2017-04-24 17:45:15:881 Script.cpp(477) Entering Script::CreateAnonymousFunction
W 2017-04-24 17:45:15:882 Script.cpp(494) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failed
W 2017-04-24 17:45:15:882 Script.cpp(180) Cannot create anonymous function

The weird thing is that the test manages to open the browser and initial login page, log into the web app and then it fails after the navigation.

wilx commented Apr 24, 2017

I am seeing this as well. My Windows 10 is 10.0.14393, IE is 11.447.14393.0, Selenium 3.3.1 with IEDriverServer 3.3.0 64bit.

T 2017-04-24 17:45:15:881 Script.cpp(477) Entering Script::CreateAnonymousFunction
W 2017-04-24 17:45:15:882 Script.cpp(494) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failed
W 2017-04-24 17:45:15:882 Script.cpp(180) Cannot create anonymous function

The weird thing is that the test manages to open the browser and initial login page, log into the web app and then it fails after the navigation.

@wilx

This comment has been minimized.

Show comment
Hide comment
@wilx

wilx Apr 26, 2017

I am having this issue since before Selenium 3. I have tried Windows 10, Windows Server 2012, Windows 7 and Windows Server 2008 R2. I have tried with the IE driver versions 3.3.0 and 3.4.0. All with the same access denied error. I tried all the tricks and registry keys, etc. I even converted the IEDriverServer locally to use the eval instead of execScript (using code from this answer on SO). No dice.

wilx commented Apr 26, 2017

I am having this issue since before Selenium 3. I have tried Windows 10, Windows Server 2012, Windows 7 and Windows Server 2008 R2. I have tried with the IE driver versions 3.3.0 and 3.4.0. All with the same access denied error. I tried all the tricks and registry keys, etc. I even converted the IEDriverServer locally to use the eval instead of execScript (using code from this answer on SO). No dice.

@jimevans

This comment has been minimized.

Show comment
Hide comment
@jimevans

jimevans Apr 26, 2017

Member

@wlix I don't have any answers for you on this one. It's clearly not globally broken for every user on every website. The best advice I can give you to try is to reset IE's settings in its options dialog (on the Advanced tab, click the Reset... button). Then reset the Protected Mode settings to be the same for all zones and try it again. If the browser is returning an "access denied" error code for the execScript COM method, there's precious little the driver can do to fix that.

Member

jimevans commented Apr 26, 2017

@wlix I don't have any answers for you on this one. It's clearly not globally broken for every user on every website. The best advice I can give you to try is to reset IE's settings in its options dialog (on the Advanced tab, click the Reset... button). Then reset the Protected Mode settings to be the same for all zones and try it again. If the browser is returning an "access denied" error code for the execScript COM method, there's precious little the driver can do to fix that.

@wilx

This comment has been minimized.

Show comment
Hide comment
@wilx

wilx Apr 27, 2017

Breakthrough! A colleague of mine has noticed that we are switching using webDriver.switchTo() either to frame("LoginFrame") or to parentFrame(). When we added webDriver.switchTo().defaultContent() after we click our login page button, the access denied error does not happen. \o/

wilx commented Apr 27, 2017

Breakthrough! A colleague of mine has noticed that we are switching using webDriver.switchTo() either to frame("LoginFrame") or to parentFrame(). When we added webDriver.switchTo().defaultContent() after we click our login page button, the access denied error does not happen. \o/

@jimevans

This comment has been minimized.

Show comment
Hide comment
@jimevans

jimevans Apr 29, 2017

Member

Given that the original reporter has not responded, I'm closing this issue.

Member

jimevans commented Apr 29, 2017

Given that the original reporter has not responded, I'm closing this issue.

@jimevans jimevans closed this Apr 29, 2017

@alexandlazaris

This comment has been minimized.

Show comment
Hide comment
@alexandlazaris

alexandlazaris Aug 17, 2017

@simonlebonbon - I was not having this issue on IE11 Win10. It worked fine for me. I WAS however having this issue on Edge. Edge executes the test differently, possibly faster, thus always failing. Keen to know your status💃

alexandlazaris commented Aug 17, 2017

@simonlebonbon - I was not having this issue on IE11 Win10. It worked fine for me. I WAS however having this issue on Edge. Edge executes the test differently, possibly faster, thus always failing. Keen to know your status💃

@krishnagovani

This comment has been minimized.

Show comment
Hide comment
@krishnagovani

krishnagovani Mar 4, 2018

@simonlebonbon I am facing the same issue. Were you able to resolve this ?

krishnagovani commented Mar 4, 2018

@simonlebonbon I am facing the same issue. Were you able to resolve this ?

@pandurusankar

This comment has been minimized.

Show comment
Hide comment
@pandurusankar

pandurusankar Aug 24, 2018

I am facing the same issue. Were you able to resolve this ?

pandurusankar commented Aug 24, 2018

I am facing the same issue. Were you able to resolve this ?

@Nisha1711

This comment has been minimized.

Show comment
Hide comment
@Nisha1711

Nisha1711 Sep 21, 2018

Iam also facing the same isuse getting this exception "OpenQA.Selenium.NoSuchElementException " in IE11 windows 10

Nisha1711 commented Sep 21, 2018

Iam also facing the same isuse getting this exception "OpenQA.Selenium.NoSuchElementException " in IE11 windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment