Selenium2学习-038-firefox、webdriver版本不对称问题解决:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055
今天有个朋友在群里问,为何脚本运行不通过,其脚本操作步骤简单描述如下:
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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- TestNG:org.openqa.selenium.firefox.NotConnectedException: Unable to connect
http://blog.sina.com.cn/s/blog_68f262210102vgzj.html 今天在尝试着用TestNG写一下自动化测试用例,以前也写过,不过用的是经常封装的代码,现在完全 ...
- selenium在Eclipse中打开fireFox浏览器是报报错connect to host 127.0.0.1 on port 7055
1.相信很多同学刚接触selenium时,在Eclipse中打开fireFox浏览器是报报错: org.openqa.selenium.firefox.NotConnectedException: U ...
- Selenium2学习-005-WebUI自动化实战实例-003-三种浏览器(Chrome、Firefox、IE)启动脚本源代码
此文主要通过 三种浏览器(Chrome.Firefox.IE)启动脚本 功能,进行 Selenium2 三种浏览器启动方法的实战实例讲解.文中所附源代码于 2015-01-18 20:33 亲测通过, ...
- 解决Selenium与firefox浏览器版本不兼容问题
因为在用java打开firefox浏览器的时候报错 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to ho ...
- Selenium firefox 版本问题
问题:Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms 原因: selenium-server-standalone-x. ...
- Selenium2学习-042-Selenium3启动Firefox Version 48.x浏览器(ff 原生 geckodriver 诞生)
今天又被坑了一把,不知谁把 Slave 机的火狐浏览器版本升级为了 48 的版本,导致网页自动化测试脚本无法启动火狐的浏览器,相关的网页自动化脚本全线飘红(可惜不是股票,哈哈哈...),报版本不兼容的 ...
随机推荐
- 消除ListView, gridview中的选项单击是的默认黄色底色
要消除其默认的单击底色,只需要在**View定义时为其添加 android:cacheColorHint="#00000000" android:listSelector=&quo ...
- 关于CCSprite不能及时显示的问题
今天在利用AFNetworking做网络请求时总是能看到添加的CCSprite精灵总是延迟一会才显示,google了半天没有找到答案, 考虑到CCSprite要被渲染才能显示,于是直接在场景中的CCL ...
- CDOJ 1437 谭松松的旅游计划 Label:倍增LCA && 最短路
谭松松的旅游计划 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit ...
- POJ 1673 EXOCENTER OF A TRIANGLE(垂心)
题目链接 折腾了半天,没想出怎么证明,以前初中老师教过,不知道怎么办,就量量...受不了,怒抄模版1Y... #include <cstdio> #include <iostream ...
- 预定义指令之debug
1)根据你必须知道的.NET一书, #define DEBUG class Program { static void Main(string[] args) { #if DEBUG Console. ...
- Flex Flash Player回声消除的最佳方法
Adobe Flash Player 已经成为音频和视频播放的非常流行的工具.实际上,目前大多数因特网视频均使用 Flash Player观看. Flash Player 通过将许多技术进行组合可以提 ...
- CentOS转的服务器磁盘规划
我的服务器是500G.最重要的是/var分区一定要大(不论postfix邮件,还是LAMP的WEB 服务器等).最好是400G以上.具体的/boot 只要100M就足够了.下面是我的分区方案:硬盘50 ...
- 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ...
- [LintCode] Flatten Binary Tree to Linked List 将二叉树展开成链表
Flatten a binary tree to a fake "linked list" in pre-order traversal. Here we use the righ ...
- java web(二) Tomcat数据源
一.数据源的产生 1.JDBC操作原理 (1) 加载数据库驱动程序(数据库驱动程序可通过classpath配置): Class.forName(); (2)通过DriverManager类取得数据库连 ...