Problem with remote Selenium IE driver “Unable to find element with css selector”

Running my Selenium tests locally against IE11 works fine, but when calling remote Selenium server running the same browser and Selenium drivers setup I get this:

System.Exception : Timed out after 10 seconds, could not find visible element 'By.CssSelector: body'
 ----> OpenQA.Selenium.WebDriverTimeoutException : Timed out after 10 seconds
 ----> OpenQA.Selenium.NoSuchElementException : Unable to find element with css selector == body

The problem is connected to the fact that the IEDriverServer.exe runs the server IE11 version. In my case this is a Windows Server 2016 which has a higher security restriction.

For me the solution was to disable the Internet Explorer Enhanced Security Configuration. Follow this guide for the Windows Server 2016 version.

Disable Internet Explorer Enhanced Security Configuration in Windows Server 2016

The same error could also be caused by javascript not enabled for the driver:

options.AddAdditionalCapability("javascriptEnabled", "true");

or need driver to switch to the correct frame/window

webDriver.switchTo().defaultContent()

More info here:
https://github.com/SeleniumHQ/selenium/issues/3611

Leave a Reply

Your email address will not be published. Required fields are marked *