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

  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. ccc 旋转

    cc.Class({ extends: cc.Component, properties: { moveSpeed: 100, rotationSpeed: 90 }, // use this for ...

  2. BZOJ2706 : [SDOI2012]棋盘覆盖

    A类数据: 将棋盘黑白染色,相邻的点之间连边,求出二分图最大匹配即可. B类数据: 答案为$\lfloor\frac{n^2-1}{3}\rfloor$,用FFT加速计算即可,时间复杂度$O(L\lo ...

  3. 20145304 第五周Java学习报告

    20145304<Java程序设计>第5周学习总结 教材学习内容总结 1.使用try.catch: 如果使用了try.catch,编译时会尝试执行try区块中的程序代码,如果有错误,执行流 ...

  4. Coder-Strike 2014 - Finals (online edition, Div. 2) A. Pasha and Hamsters

    水题 #include <iostream> #include <vector> #include <algorithm> using namespace std; ...

  5. [Leetcode] Subsets II

    Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: ...

  6. web安全测试

  7. POJ 1141 Brackets Sequence(DP)

    题目链接 很早 很早之前就看过的一题,今天终于A了.状态转移,还算好想,输出路径有些麻烦,搞了一个标记数组的,感觉不大对,一直wa,看到别人有写直接输出的..二了,直接输出就过了.. #include ...

  8. 自己签发免费ssl证书

    自己制作ssl证书:自己签发免费ssl证书,为nginx生成自签名ssl证书 这里说下Linux 系统怎么通过openssl命令生成 证书. 首先执行如下命令生成一个keyopenssl genrsa ...

  9. 使用forever管理nodejs应用

    1. forever介绍 forever是一个简单的命令式nodejs的守护进程,能够启动,停止,重启App应用.forever完全基于命令行操作,在forever进程之下,创建node的子进程,通过 ...

  10. 在springmvc中,获取Connection接口

    ServletContext context = request.getSession().getServletContext();WebApplicationContext wac = WebApp ...