参考链接: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 环境搭建的更多相关文章

  1. Selenium & Webdriver 远程测试和多线程并发测试

    Selenium & Webdriver 远程测试和多线程并发测试 Selenium Webdriver自动化测试,初学者可以使用selenium ide录制脚本,然后生成java程序导入ec ...

  2. Selenium win7+selenium2.0+python+JetBrains PyCharm环境搭建

    win7+selenium2.0+python+JetBrains PyCharm环境搭建 by:授客 QQ:1033553122 步骤1:下载python 担心最新版的支持不太好,这里我下载的是py ...

  3. 总结Selenium自动化测试方法(二)测试环境搭建

    (接上期内容) 二.测试环境搭建 1.安装python 现在python3.0比python2.0多了一些改进的功能(详见http://zhidao.baidu.com/link?url=3sT1g7 ...

  4. 【控制连接实现信息共享---linux和设备下ssh和远程连接telnet服务的简单搭建】

    SSH的配置 空密码登陆ssh server 如果要登录ssh server通常要在server和client之间采取具有共同加密的秘钥,若每次当client想要了:连接ssh server时都要手工 ...

  5. MFC ADO连接Oracle12c数据库 客户端环境搭建

    ADO连接方式一:Provider=MSDAORA.1; 环境配置如下: 去官网下载ODAC121024Xcopy_32bit.zip安装 安装方式如下: (1)解压文件 (2)用命令行CD到该文件的 ...

  6. [z]Windows 下基于 Eclipse 的可视化远程 Linux C/C++ 开发环境搭建

    http://blog.csdn.net/lostaway/article/details/8086056 1.简介 Windows 下远程 Linux 开发工具,比较著名的就是 WinGDB 和 M ...

  7. Python+Selenium - Web自动化测试(一):环境搭建

    清单列表: Python 3x Selenium Chrome Pycharm 一.Python的安装: Python官网下载地址:https://www.python.org/ 1.  进入官网地址 ...

  8. win7 eclipse连接hadoop2.x开发环境搭建

    环境: hadoop-2.3.0-cdh5.1.0 centos 6.5 x64 win7 eclipse4.3 0. 前提条件 ,jdk,maven要安装好. 1.下载hadoop,用winRAR解 ...

  9. 【selenium+python】之Python Flask 开发环境搭建(Windows)

    一.先安装python以及pip 二.其次, Python的虚拟环境安装: 在github上下载https://github.com/pypa/virtualenv/tree/master  zip文 ...

随机推荐

  1. 学习世界模型,通向AI的下一步:Yann LeCun在IJCAI 2018上的演讲

    https://baijiahao.baidu.com/s?id=1606296521706399213&wfr=spider&for=pc 机器之心整理,机器之心编辑部. 人工智能顶 ...

  2. 【R】自定义函数方法

  3. how-to-get-a-job-in-deep-learning

    http://blog.deepgram.com/how-to-get-a-job-in-deep-learning/ How to Get a Job In Deep Learning 22 SEP ...

  4. Python编译exe

    有几种办法,选择py2exe,从pip安装,还不行,下载看起来都比较老,还是在csdn上下载了一个64位版本for2.7的 http://download.csdn.net/download/henu ...

  5. 跨域资源共享(CORS)--跨域ajax

    几年前,网站开发者都因为ajax的同源策略而撞了南墙.当我们惊叹于XMLHttpRequest对象跨浏览器支持所带来的巨大进步时,我们很快发现没有一个方法可以使我们用JavaScript实现请求跨域访 ...

  6. [Spring Boot] Complex Scope Scenarios of a Spring Bean - Mix Prototype and Singleton, ScopeProxy

    We have the following example: @SpringBootApplication public class In28minutesScopeApplication { pri ...

  7. ASP入门(五)- VBScript过程和函数

    VBScript过程 被封装在Sub和End Sub语句之中的一系列语句 不具有返回值 可带参数 我们的SubFunction.asp中展示了Sub的用法,代码如下: <% Sub mySub( ...

  8. 前端html用一个表单来映射后台多个对象

    public class entity1 { private String id; public String getId() { return id; } public void setId(Str ...

  9. robot framework + python实现http接口自动化测试框架

    https://www.jianshu.com/p/6d1e8cb90e7d 前言 下周即将展开一个http接口测试的需求,刚刚完成的java类接口测试工作中,由于之前犯懒,没有提前搭建好自动化回归测 ...

  10. HTML DOM 基础知识,成为javascript晋级高手的必备手册

    一.DOM 简介,什么是 DOM? 文件对象模型(Document Object Model,简称DOM),是W3C组织推荐的处理可扩展置标语言的标准编程接口. 标记语言,也称置标语言,是一种将文本( ...