WebDriverException: Message: 'IEDriverServer.exe' executable needs to be in PATH.

详细描述:想用ie浏览器来执行测试用例,按照官方文档http://code.google.com/p/selenium/wiki/IEDriver 的步骤操作后还是报WebDriverException: Message: 'IEDriverServer.exe' executable needs to be in PATH的错,配了系统环境变量重启后也没用。

 

用下面这种方法设环境变量就可以:

import os
from selenium import webdriver
iedriver = "F:\My\Software\IEDriverServer_x64_3.141.0\IEDriverServer.exe"
os.environ["webdriver.ie.driver"] = iedriver
driver =  webdriver.Ie(iedriver)

#driver = webdriver.Ie()
driver.get('https://www.baidu.com/')

 

posted @ 2019-02-17 11:02  blueteer  阅读(2383)  评论(0编辑  收藏  举报