【总结】selenium webdriver 远程连接firefox和IE 环境搭建
参考链接:http://code.google.com/p/selenium/wiki/Grid2
本地环境为:win7,eclipse,jdk 1.7,本机ip为192.168.0.30
1.下载所需文件
1.1 下载好jar包,下载网址为:http://selenium.googlecode.com/files/selenium-server-standalone-2.37.0.jar 目前2.37为最新版本,或者直接点击官网 http://docs.seleniumhq.org/download/,
Selenium Server (formerly the Selenium RC Server)
The Selenium Server is needed in order to run either Selenium RC style scripts or Remote Selenium Webdriver ones. The 2.x server is a drop-in replacement for the old Selenium RC server and is designed to be backwards compatible with your existing infrastructure.
Download version 2.37.0
To use the Selenium Server in a Grid configuration see the wiki page.
点击2.37.0超链接即可下载。
1.2下载好IEDriverServer.exe,打开IE的驱动程序,这里选择32位的哦,64位的有bug.(系统是64位的用32位驱动也能启动IE)
The Internet Explorer Driver Server
This is required if you want to make use of the latest and greatest features of the WebDriver InternetExplorerDriver. Please make sure that this is available on your $PATH (or %PATH% on Windows) in order for the IE Driver to work as expected.
Download version 2.37.0 for (recommended) 32 bit Windows IE or 64 bit Windows IE
CHANGELOG
点击 32 bit Windows IE,即可下载,或者直接点击http://code.google.com/p/selenium/downloads/detail?name=IEDriverServer_Win32_2.37.0.zip 下载
2.把下载好的jar包随便放到一个目录下,编辑一个txt文件,然后把下面的代码改下,保存为.bat文件,双击之后即打开了selenium rc 的4444端口,程序即是从此调用开始的。
打开firefox端口脚本如下:
java -jar D:\developsoft\Selenium_Test\selenium-server-standalone-2.35.0.jar -browser “browserName=firefox,version=25.0,firefox_binary=C:\Program Files\Mozilla Firefox\firefox.exe,maxInstances=5, platform=WINDOWS”
打开IE端口脚本如下:
java -Dwebdriver.ie.driver=D:\developsoft\Selenium_Test\IEDriverServer.exe -jar D:\developsoft\Selenium_Test\selenium-server-standalone-2.35.0.jar -mode hub
3.java程序配置连接设置情况:
firefox程序配置如下:
DesiredCapabilities ffCapabilities = DesiredCapabilities.firefox();
webDriver = new RemoteWebDriver(new URL("http://192.168.0.30:4444/wd/hub"), ffCapabilities);//在另一台电脑上打开本机即可。
ie程序配置如下:
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer(); //internetExplorer
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
webDriver = new RemoteWebDriver(new URL("http://192.168.0.30:4444/wd/hub"), DesiredCapabilities.internetExplorer());
4.可以开始写测试脚本程序了
这里只是讲环境搭建,就不举实例了,如有问题欢迎留言。
【总结】selenium webdriver 远程连接firefox和IE 环境搭建的更多相关文章
- Selenium & Webdriver 远程测试和多线程并发测试
Selenium & Webdriver 远程测试和多线程并发测试 Selenium Webdriver自动化测试,初学者可以使用selenium ide录制脚本,然后生成java程序导入ec ...
- Selenium win7+selenium2.0+python+JetBrains PyCharm环境搭建
win7+selenium2.0+python+JetBrains PyCharm环境搭建 by:授客 QQ:1033553122 步骤1:下载python 担心最新版的支持不太好,这里我下载的是py ...
- 总结Selenium自动化测试方法(二)测试环境搭建
(接上期内容) 二.测试环境搭建 1.安装python 现在python3.0比python2.0多了一些改进的功能(详见http://zhidao.baidu.com/link?url=3sT1g7 ...
- 【控制连接实现信息共享---linux和设备下ssh和远程连接telnet服务的简单搭建】
SSH的配置 空密码登陆ssh server 如果要登录ssh server通常要在server和client之间采取具有共同加密的秘钥,若每次当client想要了:连接ssh server时都要手工 ...
- MFC ADO连接Oracle12c数据库 客户端环境搭建
ADO连接方式一:Provider=MSDAORA.1; 环境配置如下: 去官网下载ODAC121024Xcopy_32bit.zip安装 安装方式如下: (1)解压文件 (2)用命令行CD到该文件的 ...
- [z]Windows 下基于 Eclipse 的可视化远程 Linux C/C++ 开发环境搭建
http://blog.csdn.net/lostaway/article/details/8086056 1.简介 Windows 下远程 Linux 开发工具,比较著名的就是 WinGDB 和 M ...
- Python+Selenium - Web自动化测试(一):环境搭建
清单列表: Python 3x Selenium Chrome Pycharm 一.Python的安装: Python官网下载地址:https://www.python.org/ 1. 进入官网地址 ...
- win7 eclipse连接hadoop2.x开发环境搭建
环境: hadoop-2.3.0-cdh5.1.0 centos 6.5 x64 win7 eclipse4.3 0. 前提条件 ,jdk,maven要安装好. 1.下载hadoop,用winRAR解 ...
- 【selenium+python】之Python Flask 开发环境搭建(Windows)
一.先安装python以及pip 二.其次, Python的虚拟环境安装: 在github上下载https://github.com/pypa/virtualenv/tree/master zip文 ...
随机推荐
- oracle常用& to_date()怎么转换带am pm的时间格式
Oracle一.字符函数--大小写转换函数1.LOWER (strexp) 返回字符串,并将所有的字符小写. select lower('ABCDE') from dual --输出empbai ...
- 用jstl标签判断一个字符串是否包含了另一个字符串
<c:if test="${fn:contains(str1,str2)}">
- 滴滴大数据算法大赛Di-Tech2016参赛总结
https://www.jianshu.com/p/4140be00d4e3 题目描述 建模方法 特征工程 我的几次提升方法 从其他队伍那里学习到的提升方法 总结和感想 神经网络方法的一点思考 大数据 ...
- VS2010自带的性能分析工具分析.NET程序的性能
这篇博文给大家分享的是,如何使用VS自带的性能分析工具来分析我们编写的.NET程序,一边找出程序性能的瓶颈,改善代码的质量.在实际开发中,性能真的很重要,往往决定一个产品的生死~良好的用户体验的基础之 ...
- LINUX 查找tomcat日志关键词
#查询catalina.out日志文件中的关键词为2016-04-13 11:26:00的日志信息 grep -C 10 '2016-04-13 11:26:00' catalina.out |mor ...
- 【Python】使用geopy由地址找经纬度等信息
代码: from geopy.geocoders import Nominatim geolocator = Nominatim() location = geolocator.geocode(&qu ...
- Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决
在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号.语法高亮度显示.智能缩进 等功能的.为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc.在启动vim时,当前用户 ...
- php5.3升级脚本
在lanmp/wdcp/wdOS的当前版本中,默认的php都是用到5.2.17的版本如需要升级到php5.3的,可使用如下脚本升级(注:此升级无安全漏洞等原因,只为某些追求高版本或应用需求需要高版本, ...
- MySql 分区 分库 分表
ubuntu下MySQL配置和管理:http://www.2cto.com/database/201306/222510.html mysql分表,分区的区别和联系:http://my.oschina ...
- 禁用系统的Ctrl+Alt+Left/Right(方向键)
对于非常多工具,如IntelliJ IDE,Ctrl+Alt+Left/Right(方向键)是一个非常重要的快捷键,可是这个快捷键经常会被一些显示相关的附属应用给占用用于调整屏幕显示的朝向,有时候即使 ...