Selenium 3.0.1 with IE11 not finding elements on Windows 10 (Works fine on Windows 7 with IE11) Selenium 3.0.1 with IE11 not finding elements on Windows 10 (Works fine on Windows 7 with IE11) selenium selenium

Selenium 3.0.1 with IE11 not finding elements on Windows 10 (Works fine on Windows 7 with IE11)


Although I'm sure you not that bothered now, I logged the same issue a few days ago and I'm still stuck (click here). I have further narrowed down the problem to security. If you increase logging you will see the below lines:

W 2017-03-06 17:27:41:539 Script.cpp(494) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failedW 2017-03-06 17:27:41:540 Script.cpp(180) Cannot create anonymous functionW 2017-03-06 17:27:41:540 ElementFinder.cpp(98) A JavaScript error was encountered executing the findElement atom. 

I have tried every security option on/off but to no avail. I'm getting the problem locally and haven't set up my CI environment so hoping that when i spin it up it should just work (fingers crossed).

P.S. I don't think you had a broken VM!!


Whenever I stumble across a 'NoSuchElementException' (albeit not on Windows or IE), this has always worked:

Add these imports:

from selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECfrom selenium.webdriver.common.by import By

Then to locate the element:

search_field = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, """//*[@id="lst-ib"]""")))search_field.send_keys('Example')

Credit to Web Scraping with Python. I hope this helps, although at the moment I don't have windows or IE to verify this in advance.