码迷,mamicode.com
首页 > 系统相关 > 详细

eclipse中运行Selenium遇到的问题

时间:2015-10-30 16:49:57      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:

1.   java.lang.NoClassDefFoundError:

 技术分享

解决方法:eclipse的java工程中导入selenium-java-2.44.0\selenium-2.44.0\libs中所有的jar包.

2.    在win7  IE8下

Selenium脚本中通过selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://10.88.15.51:8080/");的方式设置浏览器
以java -jar selenium-server.jar不带参数的方式启动selenium server

运行脚本时,系统会报以下的错误:

 技术分享

问题出现原因:

1.在WIN7 IE8的环境下时,IE被设置为“Protected Mode”,导致selenium无法打开IE.(protected mode 是在英文操作系统下的名字,中文操作系统,大家自己对应吧)

2.selenium在IE中运行比较慢,如果用google的chrome会快一点。

解决方法:

1.将IE的“Protected Mode”设置取消。Internet Options->Security->" Internet " icon->Enable Protected Mode(英文版)

2.采用其他浏览器, Google Chrome 或者 Firefox 3.0

3. Could not contact Selenium Server:

 技术分享

 

问题出现原因:

    1. 没有启动selenium server

解决方法:

         1.cmd窗口启动selenium server服务

eclipse中运行Selenium遇到的问题

标签:

原文地址:http://www.cnblogs.com/zhuhaiying/p/4923678.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!