selenium与firefox版本不兼容
报错信息:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
一、 geckodriver.exe下载地址:
https://github.com/mozilla/geckodriver/releases
下载geckodriver.exe并放在C盘driver目录下。
下图说明geckodriver 15.0的版本要求selenium 版为3.3以上。 
二、对应firefox版本要求为48.0及以上
从selenium 3.0.0开始就要求firefox为48及以上版本,可以通过selenium changelog查看。
changelog查看方式: 由于浏览器访问限制无法打开selenium官网的change log, 可以通过百度搜索selenium changelog去Github上查看。

查看firefox支持版本的另一种方式:使用WINRAR打开selenium-server-standalone-3.3.1.jar>org>openqa>selenium>firefox>webdriver.xpi>install.rdf, 最后人xpi和rdf文件使用winrar右键的查看文件功能查看。

三、代码设置:

前面被注释掉的那一行“webdriver.firefox.marionette”是之前从网上找的代码,因为这句代码花费了很长的时间来定位问题。
使用这个代码的时候,运行程序一直提示本文开头的错误,所以我就以为是firefox浏览器和selenium不兼容导致,换了各种firefox浏览器版本。
换到48的时候我可以肯定selenium、geckodriver.exe、firefox版本是没有问题的,那如果有问题的话应该就是geckodriver.exe使用的问题。
后来又在网上搜到geckodriver.exe的调用方法,发现与我原来写的有区别,更新为webdriver.gecko.driver之后运行程序正确,后又将firefox升级到目前最新版52再次测试通过。
到此结束,各软件版本如下:
selenium-server-standlone-3.3.1.jar
geckodriver.exe V.15.0
firefox 48.0.2 /52.0.2
selenium与firefox版本不兼容的更多相关文章
- 解决selenium与firefox版本不兼容问题
Python环境下类比 个人使用 32位环境 Python 2.7.12 Selenium 2.53.6 Firefox 47.01 安装selenium可用pip选择对应版本,参考另一教程. 因为在 ...
- 解决selenium和FireFox版本不兼容问题
相信很多同学刚接触selenium时,在Eclipse中打开fireFox浏览器时会报错:org.openqa.selenium.firefox.NotConnectedException: Unab ...
- selenium和Firefox版本不兼容
selenium8.py coding = utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.get(' ...
- selenium 与 firefox版本不兼容报错
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 ...
- Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary
此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa ...
- 解决Selenium与firefox浏览器版本不兼容问题
因为在用java打开firefox浏览器的时候报错 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to ho ...
- Selenium firefox 版本问题
问题:Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms 原因: selenium-server-standalone-x. ...
- selenium ide几个版本和对应的firefox版本
最近安装selenium ide折腾了好久,可能是目前还不太熟悉自动化脚本录制的一些知识. 通过最新版firefox59安装的selenium ide 3.0.2录制的脚本不能导出.于是下载了低版本的 ...
- selenium启动firefox、ie、chrome各浏览器方法
1.启动firefox浏览器 a.如果你的本地firefox是默认路径安装的话,如下方式即可启动浏览器 WebDriver driver = new FirefoxDriver(); driver.g ...
随机推荐
- Python文件操作——逐行插入内容
需求: 分析: 1)打开文件 2)readlines() 读文件(按行读) --> 拿到文件内容 data 3)循环遍历 data 的每行,在每行后面进行拼接要插入的内容 4)往新文件里写 代码 ...
- 如何安装secureCRT8.1破解
安装地址 网盘: https://pan.baidu.com/s/1iGxi6BTCMC_jewCwcUHhgA 密码: u6jq 安装教程 1.点击安装 2.全部默认即可,安装完成之后再桌面上右击该 ...
- Linux中变量测试与内容替换
- 007-搭建框架-开发AOP框架
一.代码地址 https://github.com/bjlhx15/smart-framework.git 二.代码编写 2.1.定义切面注解 增加Aspect注解 package com.lhx.s ...
- More about Parameter Passing in Python(Mainly about list)
我之前写了一篇关于Python参数传递(http://www.cnblogs.com/lxw0109/p/python_parameter_passing.html)的博客, 写完之后,我发现我在使用 ...
- Java 如何读取resources
Sample in Github 1.一般使用Maven创建Java工程,代码文件在src/main/java文件夹中,资源文件在src/main/resources文件夹中,Java代码为什么可以读 ...
- django-admin 登录之后显示页面,表是否显示
如果是超级用户可以全部看到(如图),如果是普通用户,只能看到user与group 虽然实现了其功能,不过有些地方没搞懂,所以有些地方出了写的不好 ```class PermissionsMixin(m ...
- django-admin 设计User外键,设计model
设置外键 class profile_user(AbstractBaseUser, PermissionsMixin): company = models.ForeignKey(Company, de ...
- 模版抽离 优化url
抽离出base模板 复制index的代码到base里面,指定views里面跳转到base.html,删除掉会变化的保留通用的 把主要内容写写在block里面,写了三个block {% block le ...
- RTC是DS1339,驱动采用的是rtc-ds1307.c
我的外部RTC是DS1339,驱动采用的是rtc-ds1307.c在内核里选上了 <*> I2C support 以及 [*] Set system time from RTC on ...