在搭建Python+Selenium自动化测试时,用python通过WebDriver驱动Firefox浏览器时,一直无法执行测试用例。

报错信息:WebDriverException: Message: 'gechodriver' executable needs to be in PATH.

原因是:pip install selenium 时,安装的是selenium 3.0.1,而这个版本是2016年10月14日刚发布的,与Firefox 46不兼容。需要重新安装Selenium 2.53.2的旧版本。

 
 

我的电脑环境;

Python 2.7.10

Firefox 46.0.1

Selenium 2.53.2

 
 

解决方法:

解决:

  1. pip uninstall selenium #卸载已有的模块
  2. pip install selenium==2.53.2 #安装指定的版本

    这时,如果timeout报错,使用python –m pip install selenium==2.53.2

    安装Selenium完成后,到DOS窗口中,进入Python环境,导入WebDriver,测试是否成功

  3. 完全卸载firefox,需要重启电脑,重新安装Firefox
  4. 执行用例,成功

 
 

(完)

如果上面没有解决你的问题,请继续搜索,不要停~~~

Selenium安装失败WebDriverException: Message: 'gechodriver' executable needs to be in PATH的更多相关文章

  1. selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)

    1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...

  2. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  3. centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...

  4. selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法

    首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...

  5. selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”

    安装了python3,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...

  6. windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH

    问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...

  7. 解决selenium.common.exception.WebDriverException:Message:'chromedriver' executable needs to be in Path

    'chromedriver' executable needs to be in Path 声明:本人萌新,刚学python不久记录一下自己的坑,发出来若能帮助到一些人尽早解决问题那便是极好的,( ̄▽ ...

  8. mac-webui-selenium下的webdriver selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    from selenium import webdriver def test1(): url='http://www.baidu.com' driver=webdriver.Chrome(" ...

  9. python 安装selenium首次运行错误selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    问题原因: 没有安装相关的支撑driver https://npm.taobao.org/mirrors/chromedriver/ 下载对应的driver 放置到python路径下

随机推荐

  1. Python Day20

    Django 表操作 1.基本操作 # 增 # # models.Tb1.objects.create(c1='xx', c2='oo') 增加一条数据,可以接受字典类型数据 **kwargs # o ...

  2. Nginx配置文件

    https://www.digitalocean.com/community/tutorials/understanding-the-nginx-configuration-file-structur ...

  3. Redis Cluster

    使用 Redis Cluster Redis 3.0 在2015年出了Stable版本,3.0版本相对于2.8版本带来的主要新特性包括: 实现了Redis Cluster,从而做到了对集群的支持: 引 ...

  4. [.net core]简介(转)

    原文地址:https://docs.microsoft.com/zh-cn/dotnet/articles/core/ NET Core 是一个通用开发平台,由 Microsoft 和 GitHub  ...

  5. ActiveMQ集群下的消息回流功能

    ------------------------------------------------------------------ "丢失"的消息 如果有broker1和brok ...

  6. yii2 解决POST 400错误

    第一种解决办法是关闭Csrf public function init(){ $this->enableCsrfValidation = false; } 第二种解决办法是在form表单中加入隐 ...

  7. Myeclipse不显示js文件错误的方法

    最近在学后台,用Myeclipse ,那么问题来了,Myeclipse 总是喜欢报 js 文件的错误,这就很烦了,看着也不舒服. 查看资料后,解决方法如下: 项目[鼠标右键] -> MyEcli ...

  8. CI模板加载css和js

    1.需求 ci无法加载css和js文件. 2.解决 删除..htaccess文件. 在config目录下配置base_url,并传给页面 $base_url = $this->config-&g ...

  9. python界面

    import easygui as g import sys while 1: g.msgbox("我一定要学会编程!","加油!") #choices = [ ...

  10. 【Network】Neutron-Docker-K8S

    Neutron-Docker-K8S openstack/neutron: Neutron is a virtual network service for Openstack. Neutron和SD ...