title: Failed to navigate to https://www.google.ca. This usually means that a call to the COM method IWebBrowser2::Navigate2() with Python Unittest Selenium
body: <pre class="lang-python prettyprint-override"><code> from selenium import webdriver
   import unittest
   from selenium.webdriver.support.ui import WebDriverWait
   from selenium.webdriver.support import expected_conditions as EC
   from selenium.webdriver.common.by import By
   from time import sleep
  
  
   class MyTestCase(unittest.TestCase):
      def setUp(self) -&gt; None:
         self.driver = webdriver.Ie(executable_path=&quot;C:\\webdriver\\IEDriverServer.exe&quot;)
         self.driver.maximize_window()
         self.driver.get(&quot;https://www.google.ca&quot;)
  
     def test_googletest(self):
         element = WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, &quot;q&quot;)))
         element.send_keys(&quot;System&quot;)
         sleep(3)
  
    def tearDown(self):
        self.driver.close()
  
  
   if __name__ == '__main__':
       unittest.main()
  </code></pre>
  <p>The code is opening the IE browser successfully but unable to get to google's website. It gets stuck on the localhost in the address bar and after some time it times out. See image below
  <a href="https://i.stack.imgur.com/B4r9h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B4r9h.jpg" alt="enter image description here" /></a></p>
  <p>Below is the error that I get:</p>
  <pre><code>Error
  Traceback (most recent call last):
    File &quot;C:\Users\mahalr\AppData\Local\Programs\Python\Python38-32\lib\unittest\case.py&quot;, line 60, in testPartExecutor
      yield
    File &quot;C:\Users\mahalr\AppData\Local\Programs\Python\Python38-32\lib\unittest\case.py&quot;, line 672, in run
      self._callSetUp()
    File &quot;C:\Users\mahalr\AppData\Local\Programs\Python\Python38-32\lib\unittest\case.py&quot;, line 630, in _callSetUp
      self.setUp()
    File &quot;C:\Users\mahalr\PycharmProjects\TestAutomation\TestAutomation.py&quot;, line 13, in setUp
      self.driver.get(&quot;https://www.google.ca&quot;)
    File &quot;C:\Users\mahalr\PycharmProjects\TestAutomation\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 333, in get
      self.execute(Command.GET, {'url': url})
    File &quot;C:\Users\mahalr\PycharmProjects\TestAutomation\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 321, in execute
      self.error_handler.check_response(response)
    File &quot;C:\Users\mahalr\PycharmProjects\TestAutomation\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py&quot;, line 242, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.WebDriverException: Message: Failed to navigate to https://www.google.ca. This usually means that a call to the COM method IWebBrowser2::Navigate2() failed. The error returned is: Received error: 0x80004005 ['Unspecified error']
  </code></pre>
  <p>Here is my pre-test setup:</p>
  <ol>
  <li>Windows 10 64 bit laptop</li>
  <li>IE Server.exe 32 bit</li>
  <li>IE11</li>
  <li>DWORD key created under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl with a name FEATURE_BFCACHE value  = 0</li>
  <li>Enable protected mode checkbox checked for all zones under Internet Options -&gt; Security tab</li>
  <li>Enable 64-bit processes for Enhanced Protected Mode (checked) - This option is disabled and checked as since it is my company laptop</li>
  </ol>
  <p><strong>Can someone please guide me as I have hit a wall with this issue and unable to find a resolution?</strong></p>