1

I tried to run IEDriverServer.exe with selenium in python.

from selenium import webdriver
webdriver.Ie("C:\Anaconda\IEDriverServer.exe")

However, I got error code:

WebDriverException                        Traceback (most recent call last)
<ipython-input-10-8d8fa329d2af> in <module>()
----> 1 webdriver.Ie("C:\Anaconda\IEDriverServer.exe")

C:\Anaconda\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\ie\webdriver.pyc in __init__(self, executable_path, capabilities, port, timeout, host, log_level, log_file)
     44              host=self.host, log_level=self.log_level, log_file=self.log_file)
     45 
---> 46         self.iedriver.start()
     47 
     48         if capabilities is None:

C:\Anaconda\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\ie\service.pyc in start(self)
     77             time.sleep(1)
     78             if count == 30:
---> 79                  raise WebDriverException("Can not connect to the IEDriver")
     80 
     81     def stop(self):

I discovered it's the firewall at work that's stopping webdriver.Ie to be launched. But webdriver.Firefox is running fine. I have proxy set up in IE internet options and as well as http_proxy. For this browser test, I will have to use IE. Not sure how I can get webdriver.Ie to fire up.

KLI
  • 1,742
  • 3
  • 15
  • 13
  • Try: `driver = webdriver.Ie(r"C:\\Anaconda\\IEDriverServer.exe")` – Richard Feb 20 '14 at 17:02
  • no, it's the same error. I have tried placing the file at different locations. Wouldn't work. thanks though. – KLI Feb 20 '14 at 17:10
  • Have you placed the IEDriverServer.exe in the Systems path? From control panel\System\Advanced Settings\Environment Variables. – Riaz Ladhani May 10 '16 at 10:56

1 Answers1

1

Please refer to the following questions:

Fast fix (insert this before invoking webdriver):

import urllib2
urllib2.getproxies = lambda: {}
Community
  • 1
  • 1
Vyacheslav Shvets
  • 1,735
  • 14
  • 23