【总结】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.可以开始写测试脚本程序了
这里只是讲环境搭建,就不举实例了,如有问题欢迎留言。
相关文章
- 宽带连接错误的处理办法
- 建立数据库链接_html连接数据库
- 连接本地数据库和远程连接他人数据库?
- 快速的安装mysql和远程连接2021.7.23
- 远程连接:Microsoft Remote Desktop for Mac 直装版
- clion连接远程编译环境开发时,头文件标红的解决方法
- 本地navcat远程连接宝塔MySQL数据库
- 【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
- 【开发环境】下载、安装 SQL Server Management Studio ( 下载 SSMS | 安装 SSMS | 连接远程数据库 )
- 教你如何使用VSCode的Remote-SSH远程连接Linux进行远程开发
- navicat无法连接postgreSQL-11的解决方案
- Java远程连接Linux服务器并执行命令及上传文件详解编程语言
- MySQL 用户上网距离:远程连接(mysql用户远程连接)
- 解决MySQL远程连接问题(mysql无法远程连接)
- IntelliJ IDEA中连接MySQL数据库的操作步骤(idea连接mysql数据库)
- 轻松玩转Linux服务器:SSH远程连接指南(ssh远程连接linux)
- 使用Oracle数据库实现表间连接(oracle数据库表连接)
- 超时解决Redis远程连接超时问题(redis登录远程连接)
- 桌面Linux X远程桌面:极速连接,无缝互通(linuxx远程)
- Redis远程连接实现全面可控(redis远程连接)
- XP与Linux的远程连接的桥梁(xp远程 linux)
- 远距离,轻松控制Linux主机(远程连接linux主机)
- MSSQL查询连接用户实现快速获取信息(mssql查连接用户)
- 使用F5远程连接 Oracle 数据库(f5远程连接oracle)
- 判断Redis连接状态探查是否一切就绪(判断是否连上redis)
- Redis集群连接哪个节点(redis集群连哪个节点)
- Oracle中掌握内连接的六大技巧(oracle中内连接6)
- 部署如何快速部署Redis单机连接(redis连接单机)
- nOracle OTN架设连接全球数据库知识网络(oracle ot)
- 猎豹傅盛:人越来越不爱生孩子了 机器人是大连接时代的新机会 | 乌镇峰会
- 用javascript连接access数据库的方法
- MYSQL不能从远程连接的一个解决方法(snotallowedtoconnecttothisMySQLserver)
- Oracle客户端的安装与远程连接配置方法分享
- Linux编译mssql扩展使用php连接sqlserver2008的使用步骤
- Win2008R2实现多用户远程连接设置方法