报错信息:

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. Qt 如何获取一个文件的 Icon 图标?

    #include <QPixmap> #include <QString> #include <QFileInfo> #include <QFileIconP ...

  2. Python电影投票系统

    电影投票:程序先给出几个目前正在上映的电影列表. 由用户给每个电影投票.最终将该用户投票信息公布出来 lst = ['北京遇上西雅图', '解救吴先生', '美国往事', '西西里的美丽传说']结果: ...

  3. 转:使用awk命令获取文本的某一行,某一列

    1.打印文件的第一列(域)                 : awk '{print $1}' filename2.打印文件的前两列(域)                 : awk '{print ...

  4. Android学习资源网站大全

    https://github.com/zhujun2730/Android-Learning-Resources 整理了一些 Android 的博客链接.学习资源网站.站在巨人的肩膀上,会看得更远.整 ...

  5. Shell Script Notes

    shell Script学习笔记 <鸟哥的Linux私房菜 3rd Edition>: @1:若变量内容中包含空格字符,则可使用双引号"或单引号'将变量内容结合起来,但不同的是: ...

  6. 内置函数(Day16)

    现在python一共为我们提供了68个内置函数.它们就是python提供给你直接可以拿来使用的所有函数     内置函数     abs() divmod() input() open() stati ...

  7. driver.close()和driver.quit()

    driver.close()关闭当前窗口 driver.quit()退出驱动关闭所有窗口 from selenium import webdriver from time import sleep d ...

  8. spring mvc 自动扫描注解失效原因

    关于spring自动扫描,在控制层,采用注解配置@Controller,项目能够成功启动,且无任何报错.但是 在进行页面跳转时,并未进行相应的拦截,整个界面只能在默认界面 ,跳转报404,由于楼主初次 ...

  9. tar软件安装

    安装tar   ./configure   make   sudo make install

  10. 【LeetCode】 子字符串思路

    在一些求字串含有固定字符最短串,含有不同字符最长子串等问题中,利用 vector<int> map(128, 0)可以解决 题一:最短给定子串 Minimum Window Substri ...