org.openqa.selenium.NoSuchWindowException

Exception in thread “main” org.openqa.selenium.NoSuchWindowException: Unable to get browser (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds

How to resolve ?

Exception in thread “main” org.openqa.selenium.NoSuchWindowException: Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds

 

Solution: This error can be resolved by following below steps-

  1. Open RUN window in your PC
  2. Type “regedit” and press ENTER
  3. This would open registry editor
  4. Go to the path if you have 64 bit OS:  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
  5. Go to the path if you have 32 bit OS: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
  6. Now set the value for iexplore.exe as 0.
  7. Please refer below screenshot.
  8. org.openqa.selenium.NoSuchWindowException

8. Restart your IE browser .

9. Run your Selenium script again, It should work as expected.

Thanks.