我已经下载了IEDriver并测试了32位和64位版本(我正在运行64位Windows 7),并且在环境变量中包括了包含EXE路径的文件夹。
我已经重新启动了Eclipse和整个系统,但是仍然出现异常
selenium.common.exceptions.WebDriverException: Message:
'IEDriver executable needs to be available in the path.
Please download from http://code.google.com/p/selenium/downloads/list
and read up at http://code.google.com/p/selenium/wiki/InternetExplorerDriver'
以下是我启动IE的测试设置:
def setUp(self):
self.driver = webdriver.Ie()
self.driver.implicitly_wait(30)
self.base_url = "https://accounts.google.com/"
self.verificationErrors = []
self.accept_next_alert = True
我很困惑我以前曾经使用过它,但是现在删除了它,现在想将其放回系统中。我正在使用Python 3.3,Eclipse 4.2.2,Selenium 2.31和IE 10.0.92
有任何想法吗?
最佳答案
您是如何设定道路的?
例如,如果IEDriverServer.exe
在C:\
中,则应将C:\
添加到PATH中,而不是C:\IEDriverServer.exe
编辑:在您的情况下,在C:\IEDriver
之前有一个分号,应将其删除。
然后重新启动Eclipse,然后重试。
编辑:您能否也请尝试在代码中指定IEDriverServer.exe的路径?
from selenium import webdriver
driver = webdriver.Ie(r"C:\\IEDriver\\IEDriverServer.exe")