今天有个朋友在群里问,为何脚本运行不通过,其脚本操作步骤简单描述如下:

  1、启动火狐浏览器

  2、打开百度

  3、查询框输入关键字

  4、点击按钮【百度一下】

脚本挺简单的,其给出的应用报错信息如下所示:

[TestNG] Running:
C:\Users\jiwei.xu\AppData\Local\Temp\testng-eclipse--429788523\testng-customsuite.xml org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

  看了一下他的脚本,发现脚本没有问题,然后要了一份详细的报错信息,发现了如下所示的错误:

FAILED CONFIGURATION: @BeforeClass beforeClass
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows:
modules/Task.jsm:315:40
TaskImpl@resource://gre/modules/Task.jsm:276:3
createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:250:14
loadManifestFromZipFile<@resource://gre/modules/addons/XPIProvider.jsm:1451:26
TaskImpl_run@resource://gre/modules/Task.jsm:315:40
TaskImpl@resource://gre/modules/Task.jsm:276:3
createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:250:14
loadManifestFromFile@resource://gre/modules/addons/XPIProvider.jsm:1461:12
AddonInstaller.InstallerService._shouldInstall/<@resource://addoninstaller/installerService.js:341:49
safeCall@resource://gre/modules/AddonManager.jsm:179:5
makeSafe/<@resource://gre/modules/AddonManager.jsm:195:25
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:933:23
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:812:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:746:11

  由以上信息看出,webdriver 无法启动火狐浏览器,从而得知导致失败错误的原因是:webdriver 版本不支持 火狐浏览器的版本导致的。

让其更换为最新的 webdriver jar 包后,问题得以解决! ^_^

建议大家在遇到问题时,依据如下步骤去解决:

  1、首先查看日志、控制台报错信息

  2、查验是否脚本的问题

  3、查验环境问题

  4、依据日志、控制台报错信息,自行解决拍错

  5、查询百度、谷歌、响应的技术论坛

  6、在相应的 QQ 群中虚心请教大神

PS:请教大神注意的事项:

  1、回答你是友情,没人回答也不要抱怨,因为这不是义务

  2、回答了,无论解决与否都要感恩解答的人

  3、提问时,要简明的说明:问题、环境、步骤、主要错误日志信息、自己尝试过的方案(解决问题所做的努力)

  4、提问后,要时常查看群消息,免得又人解答问你问题你又不在,要积极配合

  5、能提供文本的,绝不提供截图

  6、若条件允许,最好给出相应的脚本代码段

至此,WebUI 自动化功能测试脚本第 038-firefox、webdriver版本对称问题解决:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 顺利完结,希望此文能够给初学 Selenium 的您一份参考。

最后,非常感谢亲的驻足,希望此文能对亲有所帮助。热烈欢迎亲一起探讨,共同进步。非常感谢! ^_^

Selenium2学习-038-firefox、webdriver版本不对称问题解决:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055的更多相关文章

  1. WebDriver:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

    今天尝试最新的webDriver与fireFox搭配: 运行代码时出现如下的问题,但是浏览器却可以打开: org.openqa.selenium.firefox.NotConnectedExcepti ...

  2. selenium 运行之后错误提示Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output

    错误提示: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port ...

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

  4. TestNG:org.openqa.selenium.firefox.NotConnectedException: Unable to connect

    http://blog.sina.com.cn/s/blog_68f262210102vgzj.html 今天在尝试着用TestNG写一下自动化测试用例,以前也写过,不过用的是经常封装的代码,现在完全 ...

  5. selenium在Eclipse中打开fireFox浏览器是报报错connect to host 127.0.0.1 on port 7055

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

  6. Selenium2学习-005-WebUI自动化实战实例-003-三种浏览器(Chrome、Firefox、IE)启动脚本源代码

    此文主要通过 三种浏览器(Chrome.Firefox.IE)启动脚本 功能,进行 Selenium2 三种浏览器启动方法的实战实例讲解.文中所附源代码于 2015-01-18 20:33 亲测通过, ...

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

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

  8. Selenium firefox 版本问题

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

  9. Selenium2学习-042-Selenium3启动Firefox Version 48.x浏览器(ff 原生 geckodriver 诞生)

    今天又被坑了一把,不知谁把 Slave 机的火狐浏览器版本升级为了 48 的版本,导致网页自动化测试脚本无法启动火狐的浏览器,相关的网页自动化脚本全线飘红(可惜不是股票,哈哈哈...),报版本不兼容的 ...

随机推荐

  1. [转]redis-cluster研究和使用--待研究

    转自:http://hot66hot.iteye.com/blog/2050676 一:关于redis cluster 1:redis cluster的现状 reids-cluster计划在redis ...

  2. Qt搭建多线程Server

    起因是MySQL在Android上没有驱动.也就是说,移动端想要访问远程数据库,必须通过一台(或多台)PC进行中转. 中转PC作为Server,接受来自移动端Socket访问数据库的要求,Server ...

  3. POJ 2480 (约数+欧拉函数)

    题目链接: http://poj.org/problem?id=2480 题目大意:求Σgcd(i,n). 解题思路: 如果i与n互质,gcd(i,n)=1,且总和=欧拉函数phi(n). 如果i与n ...

  4. ACM 喷水装置(一)

    喷水装置(一) 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以 ...

  5. 1204. Maze Traversal

    1204.   Maze Traversal A common problem in artificial intelligence is negotiation of a maze. A maze ...

  6. SQL中union运算操作的理解

    在SQL中,对于并运算,可以使用union关键字. 例如: SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FRO ...

  7. RSA_RSA算法原理(二)

    上一次,我介绍了一些数论知识. 有了这些知识,我们就可以看懂RSA算法.这是目前地球上最重要的加密算法. 六.密钥生成的步骤 我们通过一个例子,来理解RSA算法.假设爱丽丝要与鲍勃进行加密通信,她该怎 ...

  8. Go语言练习:网络编程实例——简易图片上传网站

    1.代码结构 2.运行实例 1.代码结构 $ tree . ├── photoweb.go ├── public │   ├── css │   ├── images │   └── js ├── u ...

  9. C/C++:[2]enum-枚举量声明、定义和使用

    C/C++:[2]enum-枚举量声明.定义和使用 转自:http://jingyan.baidu.com/article/e75aca85526c1b142edac6d9.html 众所周知,C/C ...

  10. The Bus Driver Problem

    题目连接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=90648#problem/G 题意: 给每位司机分配一个白天和晚上的行车路线, ...