selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Unable to find elements on IE 11, Windows Server 2012 R2

Open daviande opened this issue 11 years ago • 10 comments

We are having some issues finding elements using WebdriverJS with IE 11 on Windows Server 2012 R2. The same code works fine on Windows 7/8/8.1, so I'm pretty sure that points to some sort of configuration issue on our side.

We've performed the IE configuration found here: https://code.google.com/p/selenium/wiki/InternetExplorerDriver

We're attempting:

driver.isElementPresent(By.tagName('body'));

And it results in:

NoSuchElementError: Finding elements with tag name == bodyreturned an unexpected error (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 311 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50' System info: host: 'ip-0AC8460B', ip: '10.200.70.11', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_51' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, enablePersistentHover=false, ie.forceCreateProcessApi=true, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=true, elementScrollBehavior=0, ie.browserCommandLineSwitches=-extoff -nohangrecovery, requireWindowFocus=true, browserName=internet explorer, initialBrowserUrl=http://localhost:29760/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}] Session ID: d8981e6a-7c0a-4b50-806e-8493c1546f0e *** Element info: {Using=tag name, value=body}

Anyone have any suggestions on what configuration we can check? Are there any known issues with Selenium on Windows Server 2012 R2?

daviande avatar Jul 23 '15 23:07 daviande

Any solution for this? Im getting the same issue.

swqajunkie avatar Jul 28 '15 21:07 swqajunkie

Any updates on this? I am stuck with the same error. Any suggestions?

manand77 avatar Aug 27 '15 23:08 manand77

HI. My solution was not to run it on windows 2012 server and stick with win professional.

swqajunkie avatar Sep 01 '15 23:09 swqajunkie

same error for me

yanivrefael avatar Sep 06 '15 11:09 yanivrefael

I'm getting a different error but not finding any elements either after navigating to page:

Unable to find element on closed window (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 31 milliseconds Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16' System info: host: 'hostname', ip: '10.1.210.147', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:6618/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}] Session ID: 992f43c9-a8ca-499d-b81a-0bfff1219621 *** Element info: {Using=tag name, value=body}

org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 31 milliseconds Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16' System info: host: 'hostname', ip: '10.1.210.147', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:6618/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}] Session ID: 992f43c9-a8ca-499d-b81a-0bfff1219621 *** Element info: {Using=tag name, value=body} at java.lang.reflect.Constructor.newInstance(Constructor.java:422) 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:595) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348) at org.openqa.selenium.remote.RemoteWebDriver.findElementByTagName(RemoteWebDriver.java:413) at org.openqa.selenium.By$ByTagName.findElement(By.java:331) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:340)

Is there any way to figure out what goes wrong?

merike avatar Oct 01 '15 10:10 merike

I found that if I added a sleep before navigating to test page and pressed F12 to open dev tools on it then following commands succeeded. Which after some googling revealed that I accidentally set up FEATURE_BFCACHE for 32bit system on a 64bit machine. Feeling silly now, but at least the test works :)

merike avatar Oct 01 '15 11:10 merike

I have the same issue, as "swqajunkie" said, dont run it on windows server, I did shift everything from server to windows 7 machine but the error is still same. Today i updated the IEDriverServer as its changelog said it will fix the issue of not finding elements but instead it throws this exception:

Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'OpenQA.Selenium.Proxy'.

As the same code works with the previous versions so I'm assuming its the driver issue, but still the issue remains. Also I found an article saying that Selenium was not designed to work with RC Server, here

So we should move everything to windows 7/8? or wait for the fix? If upgrading to 2.52.2 fixed someone's issue then please let me know.

sophiaatif avatar Mar 15 '16 16:03 sophiaatif

@sophiaatif Can you please post the line of code that produces that exception? I do not understand how the .NET bindings would be attempting to parse a JSON response as a Proxy object from a call to FindElement or FindElements.

jimevans avatar Mar 15 '16 19:03 jimevans

Running my tests on R2 2012 only, and got the same error as @merike .. Solved it in a similar fashion by navigating back to the IDE and then to IE 11 again.

@daviande : I'd suggest to check the config again.

  1. Ignore zoom level - true
  2. Ignore protected mode settings - true

vroonarora avatar Jan 04 '18 20:01 vroonarora

Closing as the issue went stale, but in addition wee never got any more information.

diemol avatar May 20 '20 05:05 diemol