终极答案搭建selenium3.11 +Firefox+python3.6自动化UI测试环境踩的坑
Posted cnb_yangwei
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了终极答案搭建selenium3.11 +Firefox+python3.6自动化UI测试环境踩的坑相关的知识,希望对你有一定的参考价值。
1 运行之后,出现如下报错
Selenium.common.exceptions.WebDriverException: Message: ‘geckodriver‘ executable needs to be in PATH
信息显示 geckodriver需要在path环境变量中
解决方法:
下载geckodriver,地址为:https://github.com/mozilla/geckodriver/releases
找到下载目录,将geckodriver.exe的安装路径添加到path里面;一般将geckodriver.exe放到Python安装目录
2 按如上方法修改后,再次运行出现如下报错
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities
信息显示geckodriver和selenium版本不兼容
我使用的版本 :selenium3.11.0 geckodriver V0.15.0
3 杀手锏,重要的事说三遍(适用于解决问题 2)
重装Firefox,版本无所谓
重装Firefox,版本无所谓
重装Firefox,版本无所谓
以上是关于终极答案搭建selenium3.11 +Firefox+python3.6自动化UI测试环境踩的坑的主要内容,如果未能解决你的问题,请参考以下文章