报错信息:

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版本不兼容的更多相关文章

  1. 解决selenium与firefox版本不兼容问题

    Python环境下类比 个人使用 32位环境 Python 2.7.12 Selenium 2.53.6 Firefox 47.01 安装selenium可用pip选择对应版本,参考另一教程. 因为在 ...

  2. 解决selenium和FireFox版本不兼容问题

    相信很多同学刚接触selenium时,在Eclipse中打开fireFox浏览器时会报错:org.openqa.selenium.firefox.NotConnectedException: Unab ...

  3. selenium和Firefox版本不兼容

    selenium8.py coding = utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.get(' ...

  4. selenium 与 firefox版本不兼容报错

    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 ...

  5. 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 ...

  6. 解决Selenium与firefox浏览器版本不兼容问题

    因为在用java打开firefox浏览器的时候报错 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to ho ...

  7. Selenium firefox 版本问题

    问题:Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms 原因: selenium-server-standalone-x. ...

  8. selenium ide几个版本和对应的firefox版本

    最近安装selenium ide折腾了好久,可能是目前还不太熟悉自动化脚本录制的一些知识. 通过最新版firefox59安装的selenium ide 3.0.2录制的脚本不能导出.于是下载了低版本的 ...

  9. selenium启动firefox、ie、chrome各浏览器方法

    1.启动firefox浏览器 a.如果你的本地firefox是默认路径安装的话,如下方式即可启动浏览器 WebDriver driver = new FirefoxDriver(); driver.g ...

随机推荐

  1. 2015-02-07——js笔记

    示例1: var abc; console.log(abc === undefined);        console.log(abc === null);        console.log(t ...

  2. Python 是怎么火起来的?

    Python 之父 Guido 正在设计 Python 语言,结果家里突然潜入一条大蟒蛇,一番激烈斗争,大蟒蛇把 Guido 叔生吞进肚,并洋洋自得:So Who is Guido Van Rossu ...

  3. Oracle 报 ORA-21561: OID generation failed 错误 mac 链接oracle

    简单的说:在终端输入:sudo scutil --set HostName localhost

  4. 0401-服务注册与发现、Eureka简介

    一.硬编码问题 解决方案:nginx.或.服务注册与发现 二.服务发现 注册.心跳机制 三.服务发现组件的功能 1.服务注册表:是一个记录当前可用服务实例的网络信息的数据库,是服务发现机制的核心.服务 ...

  5. 使用git工具上传项目到github步骤

    这里记录一下上传项目到github的步骤.使用的工具是Git bash. 1.登陆github,没有账户就注册一个,新建一个Repository(仓库). 2.绑定用户. 因为Git是分布式版本控制系 ...

  6. PHP获取微信openid 简单教程

    //***方法一 获取code https://open.weixin.qq.com/connect/oauth2/authorize?appid=这里是你的公众号的APPID&redirec ...

  7. HAProxy的状态页

    启用基于程序编译时默认设置的统计报告,不能用于"frontend"区段,只要没有另外的其他设定,他们就会使用如下的配置stats uri    : /haproxy$statsst ...

  8. 剑指offer 面试43题

    面试43题: 题目:1~n整数中1出现的次数 题:输入一个整数n,求1~n这n个整数的十进制表示中1出现的次数.例如,输入12,1~12这些整数中包含1的数字有1,10,11,12一共出现了5次. 解 ...

  9. 3.6中的range()

    在python3中range()是这样的: >>> range(4) range(0, 4) #额,列表跑哪去了 在之前的python2中是这样的: >>> ran ...

  10. Shell 条件判断总结

    -b file 若文件存在且是一个块特殊文件,则为真 -c file 若文件存在且是一个字符特殊文件,则为真 -d file 若文件存在且是一个目录,则为真 -e file 若文件存在,则为真 -f ...