Resolving Selenium IE Driver "Unable to Find Element" Error on IE11

When using Selenium with Intrenet Explorer 11, a common error encountered is:

OpenQA.Selenium.NoSuchWindowException: Unable to find element on closed window

This issue occurs becuase IE11 does not fully support Selenium 2.0's WebDriver protocol, particularly when trying to locate elements on a page.

Solution: Modify Windows Registry

For IE 11 specifically, you need to set a registry entry on the target machine to allow the driver to maintain a connection with the Internet Explorer instance it creates.

Steps:

  1. Open the Registry Editor by pressing Win + R, typing regedit, and pressing Enter.

  2. Navigate to the appropriate registry key based on your Windows version:

    • For 32-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

    • For 64-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

  3. If the FEATURE_BFCACHE subkey does not exist under FeatureControl, create it by right-clicking and selecting New → Key. Name it exactly FEATURE_BFCACHE.

  4. Inside the FEATURE_BFCACHE key, create a new DWORD (32-bit) value:

    • Name: iexplore.exe
    • Value: 0
  5. Close the Registry Editor and restart your computer for the changes to take effect.

  6. After restarting, launch your development environment (e.g., Visual Studio, Eclipse) as an Administrator. Running without administrator privileges may cause the error to persist.

  7. Run your project again. The element-finding issue should now be resolved.

Tags: Selenium IE11 Registry webdriver troubleshooting

Posted on Mon, 18 May 2026 20:23:54 +0000 by dtdetu