KLI
KLI

Reputation: 1782

Unable to run IEDriverServer.exe with proxy set up in IE internet option

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.

Upvotes: 1

Views: 1572

Answers (1)

Vyacheslav Shvets
Vyacheslav Shvets

Reputation: 1844

Please refer to the following questions:

Fast fix (insert this before invoking webdriver):

import urllib2
urllib2.getproxies = lambda: {}

Upvotes: 1

Related Questions