报错信息:

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. JavaWeb 之事务

    什么是事务? 事务就是逻辑上的一组操作,组成事务的各个执行单元,操作要么全部成功,要么全部失败. 以转账为例: 张三给李四转账,张三扣1000,李四加1000; 加钱和扣钱两个操作组成了一个事务. 1 ...

  2. Vue.js中this.$nextTick()的使用

    this.$nextTick()将回调延迟到下次 DOM 更新循环之后执行.在修改数据之后立即使用它,然后等待 DOM 更新.它跟全局方法 Vue.nextTick 一样,不同的是回调的 this 自 ...

  3. 洛谷P5274 优化题(ccj)

    洛谷P5274 优化题(ccj) 题目背景 CCJCCJ 在前往参加 Universe \ OIUniverse OI 的途中... 题目描述 有一个神犇 CCJCCJ,他在前往参加 Universe ...

  4. 常用模块一(os模块、序列化模块(json和pickle))

    一.os模块 os模块是与操作系统交互的一个接口. import os # 和文件和文件夹的操作有关 os.makedirs('dirname1/dirname2') # 可生成多层递归目录 os.r ...

  5. exist & in

    select a.* from A a where exists ( select 1 from B b where a.id=b.id ) public List exist(){ List res ...

  6. Loadrunder脚本篇——Run-time Settings之Browser Enmulation

    浏览器模拟 所有Internet Vuser Header包含一个标识将被模拟的浏览器类型(或无线工具包)的User Agent header.例如User-Agent: Mozilla/3.01Go ...

  7. 每天一个Linux命令(47)route命令

        Linux系统的route命令用于显示和操作内核IP路由表(show / manipulate the IP routing table).     (1)用法:     用法:  route ...

  8. 027_编写MapReduce的模板类Mapper、Reducer和Driver

    模板类编写好后写MapReduce程序,的模板类编写好以后只需要改参数就行了,代码如下: package org.dragon.hadoop.mr.module; import java.io.IOE ...

  9. git全局忽略

    今天在提交一个本地新建的build文件夹内的文件时,sourceTree始终无法找到该文件夹下的任何内容,但是项目中的.gitignore中并没有写/build/配置,于是开始了填坑之路! 首先从表象 ...

  10. HNOI2019梦游记

    \(Day_0\) 十点半开始睡觉,开始了八个小时的不眠之夜,整晚都没睡着,这状态明天肯定挂了 \(Day_1\) 开局一条鱼,计算几何只会\(20\) 还是\(T2\)的\(20\)纯暴力好打,\( ...