【总结】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文 ...
随机推荐
- 揭秘uc浏览器一
首先,看一下项目完成后的,最终效果是这样的: 一.主界面 二,书签界面 三.主界面 四.操作对话框界面 这几个界面你是否看到了uc浏览器的影子了,其实我说你也可以了,在接下来篇幅中,我将手把手叫大家完 ...
- Matplotlib.pyplot 常用方法
1.介绍 Matplotlib 是一个 Python 的 2D绘图库,它以各种硬拷贝格式和跨平台的交互式环境生成出版质量级别的图形.通过 Matplotlib,开发者可以仅需要几行代码,便可以生成绘图 ...
- (转)[Unity3D]BuildPipeline.PushAssetDependencies 打包依赖包,优化UI Prefab的资源引用加载(坑爹之处)
转自:http://blog.csdn.net/chiuan/article/details/39040421#reply 1:长话短说,UI Prefab中一般会交叉引用Atlas,那么打包时候我们 ...
- HTML5画布生成的3D飞船舰队效果
在线演示 本地下载 使用HTML5画布2D来模拟3D的空间效果,生成舰队飞行效果,了解如何开发,请阅读下面代码相关“轻视频”: HTML5画布模拟生成3D的舰队飞行效果
- Activity设置为对话框属性时(Theme.Dialog)时,改变其在屏幕中的位置
如果有需要要将Activity变成一个窗口形式(在Manifest.xml中的activity标签设置android:theme="@android:style/Theme.Dialog&q ...
- iOS开发点滴 - 如何通过Segue写代码传递数据从一个ViewController到另一个ViewController(Swift代码)
1. 拖线 按住Control键,用鼠标从源控制器的某个控件开始,拖动到目的控制器 2. 选择弹出类型并设置Segue Identifier 在弹出的对话框中,选择“Selection Segue-& ...
- SqlServer判断表、列不存在则创建
一.表不存在则创建: if not exists (select * from sysobjects where id = object_id('mytab') and OBJECTPROPERTY( ...
- flume 集群datanode节点失败导致hdfs写失败(转)
来自:http://www.geedoo.info/dfs-client-block-write-replace-datanode-on-failure-enable.html 这几天由于杭州集群处于 ...
- 通过淘宝接口免费获取IP地址信息
1.获取互联网访问IP信息 一般获取互联网访问的IP的相关信息一般都是收费接口,免费的接口不多,我使用到一个接口如下: http://ip.taobao.com/service/getIpInfo.p ...
- stopPropagation 和stopImmediatePropagation区别
1.示例代码 <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UT ...