Watir-Webdriver环境搭建(for WIN OS)
2012-10-23 18:54
323 查看
step1:下载相关资源
http://rubyforge.org/
主要资源:rubyinstaller-1.9.2-p290.exe (为1.9.2版本即可)
备用资源:rubygems-update-1.8.24.gem(最新版本即可)
http://code.google.com/p/selenium/downloads/list
主要资源:IEDriverServer_Win32_2.25.3.zip(最新版本即可)
step2:安装ruby
运行rubyinstaller-1.9.2-p290.exe,安装界面勾选项全选。命令窗口验证如下,安装成功。
C:\>ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
C:\>gem -v
1.7.2
step3:升级gem
如果网络正常可在线升级;否则,用备用资源rubygems-update-1.8.x.gem本地升级。
在线升级:
C:\>gem update --system
Updating rubygems-update
Fetching: rubygems-update-1.8.24.gem (100%)
Successfully installed rubygems-update-1.8.24
Installing RubyGems 1.8.24
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
* 1 bug fix:
* Install the .pem files properly. Fixes #320
* Remove OpenSSL dependency from the http code path
-------------------------------------------------------
RubyGems installed the following executables:
C:/Ruby192/bin/gem
RubyGems system software updated
C:\>gem -v
1.8.24
step4:安装watir-webdriver
在线安装,若本地安装需下载相关gem包。
C:\>gem install watir-webdriver
Fetching: multi_json-1.3.6.gem (100%)
Fetching: rubyzip-0.9.9.gem (100%)
Fetching: ffi-1.1.5-x86-mingw32.gem (100%)
Fetching: childprocess-0.3.6.gem (100%)
Fetching: addressable-2.3.2.gem (100%)
Fetching: libwebsocket-0.1.5.gem (100%)
Fetching: selenium-webdriver-2.25.0.gem (100%)
Fetching: watir-webdriver-0.6.1.gem (100%)
Successfully installed multi_json-1.3.6
Successfully installed rubyzip-0.9.9
Successfully installed ffi-1.1.5-x86-mingw32
Successfully installed childprocess-0.3.6
Successfully installed addressable-2.3.2
Successfully installed libwebsocket-0.1.5
Successfully installed selenium-webdriver-2.25.0
Successfully installed watir-webdriver-0.6.1
8 gems installed
Installing ri documentation for multi_json-1.3.6...
Installing ri documentation for rubyzip-0.9.9...
Installing ri documentation for ffi-1.1.5-x86-mingw32...
Installing ri documentation for childprocess-0.3.6...
Installing ri documentation for addressable-2.3.2...
Installing ri documentation for libwebsocket-0.1.5...
Installing ri documentation for selenium-webdriver-2.25.0...
Installing ri documentation for watir-webdriver-0.6.1...
Installing RDoc documentation for multi_json-1.3.6...
Installing RDoc documentation for rubyzip-0.9.9...
Installing RDoc documentation for ffi-1.1.5-x86-mingw32...
Installing RDoc documentation for childprocess-0.3.6...
Installing RDoc documentation for addressable-2.3.2...
Installing RDoc documentation for libwebsocket-0.1.5...
Installing RDoc documentation for selenium-webdriver-2.25.0...
Installing RDoc documentation for watir-webdriver-0.6.1...
C:\>gem list watir
*** LOCAL GEMS ***
watir-webdriver (0.6.1)
C:\>
step5:安装IEDriverServer
解压IEDriverServer_Win32_2.25.3.zip,将IEDriverServer.exe放置ruby安装路径: C:\Ruby192\bin(视自己安装路径而定)
step6:验证watir-webdriver
C:\>irb
irb(main):001:0> require 'watir-webdriver'
=> true
irb(main):002:0> Watir::Browser.new :ie
Started InternetExplorerDriver server (32-bit)
2.25.3.0
Listening on port 5555
=> #<Watir::Browser:0x535c826e url="http://localhost:5555/" title="WebDriver">
irb(main):003:0>
提示:红色部分为手工输入命令,注意空格!!
http://rubyforge.org/
主要资源:rubyinstaller-1.9.2-p290.exe (为1.9.2版本即可)
备用资源:rubygems-update-1.8.24.gem(最新版本即可)
http://code.google.com/p/selenium/downloads/list
主要资源:IEDriverServer_Win32_2.25.3.zip(最新版本即可)
step2:安装ruby
运行rubyinstaller-1.9.2-p290.exe,安装界面勾选项全选。命令窗口验证如下,安装成功。
C:\>ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
C:\>gem -v
1.7.2
step3:升级gem
如果网络正常可在线升级;否则,用备用资源rubygems-update-1.8.x.gem本地升级。
在线升级:
C:\>gem update --system
Updating rubygems-update
Fetching: rubygems-update-1.8.24.gem (100%)
Successfully installed rubygems-update-1.8.24
Installing RubyGems 1.8.24
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
* 1 bug fix:
* Install the .pem files properly. Fixes #320
* Remove OpenSSL dependency from the http code path
-------------------------------------------------------
RubyGems installed the following executables:
C:/Ruby192/bin/gem
RubyGems system software updated
C:\>gem -v
1.8.24
step4:安装watir-webdriver
在线安装,若本地安装需下载相关gem包。
C:\>gem install watir-webdriver
Fetching: multi_json-1.3.6.gem (100%)
Fetching: rubyzip-0.9.9.gem (100%)
Fetching: ffi-1.1.5-x86-mingw32.gem (100%)
Fetching: childprocess-0.3.6.gem (100%)
Fetching: addressable-2.3.2.gem (100%)
Fetching: libwebsocket-0.1.5.gem (100%)
Fetching: selenium-webdriver-2.25.0.gem (100%)
Fetching: watir-webdriver-0.6.1.gem (100%)
Successfully installed multi_json-1.3.6
Successfully installed rubyzip-0.9.9
Successfully installed ffi-1.1.5-x86-mingw32
Successfully installed childprocess-0.3.6
Successfully installed addressable-2.3.2
Successfully installed libwebsocket-0.1.5
Successfully installed selenium-webdriver-2.25.0
Successfully installed watir-webdriver-0.6.1
8 gems installed
Installing ri documentation for multi_json-1.3.6...
Installing ri documentation for rubyzip-0.9.9...
Installing ri documentation for ffi-1.1.5-x86-mingw32...
Installing ri documentation for childprocess-0.3.6...
Installing ri documentation for addressable-2.3.2...
Installing ri documentation for libwebsocket-0.1.5...
Installing ri documentation for selenium-webdriver-2.25.0...
Installing ri documentation for watir-webdriver-0.6.1...
Installing RDoc documentation for multi_json-1.3.6...
Installing RDoc documentation for rubyzip-0.9.9...
Installing RDoc documentation for ffi-1.1.5-x86-mingw32...
Installing RDoc documentation for childprocess-0.3.6...
Installing RDoc documentation for addressable-2.3.2...
Installing RDoc documentation for libwebsocket-0.1.5...
Installing RDoc documentation for selenium-webdriver-2.25.0...
Installing RDoc documentation for watir-webdriver-0.6.1...
C:\>gem list watir
*** LOCAL GEMS ***
watir-webdriver (0.6.1)
C:\>
step5:安装IEDriverServer
解压IEDriverServer_Win32_2.25.3.zip,将IEDriverServer.exe放置ruby安装路径: C:\Ruby192\bin(视自己安装路径而定)
step6:验证watir-webdriver
C:\>irb
irb(main):001:0> require 'watir-webdriver'
=> true
irb(main):002:0> Watir::Browser.new :ie
Started InternetExplorerDriver server (32-bit)
2.25.3.0
Listening on port 5555
=> #<Watir::Browser:0x535c826e url="http://localhost:5555/" title="WebDriver">
irb(main):003:0>
提示:红色部分为手工输入命令,注意空格!!
相关文章推荐
- Ubuntu上搭建Watir-Webdriver与Cucumber环境
- 一步步教你搭建VS环境下用C#写WebDriver脚本
- Windows环境搭建Web自己主动化測试框架Watir(基于Ruby)
- selenium+webDriver环境搭建和学习基础(java环境)
- ATX 文档 - iOS WebDriverAgent 环境搭建 入门
- selenium webdriver 环境搭建--java
- 曲折的WebDriver环境搭建(selenium WebDriver eclipse 环境搭建)
- selenium webdriver之eclipse java开发环境搭建
- 搭建WebDriver(Java)开发环境
- iOS WebDriverAgent 环境搭建
- Selenium Webdriver Python 测试环境搭建
- Selenium Webdriver 自动化测试环境搭建、入门
- selenium webdriver之(1).eclipse java开发环境搭建
- python webdriver 环境搭建详解
- WebDriver Selenium eclipse环境搭建
- Selenium2+Java+Window 下测试环境搭建、WebDriver驱动
- jruby+watir-webdriver+cucumber自动化测试环境配置
- Selenium Webdriver 环境搭建
- selenium webdriver之eclipse java开发环境搭建
- Selenium Webdriver学习记录(一):环境搭建(Java+Maven+Eclipse+Selenium3.x)+第一个测试demo+部分问题解决