Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

第 4 章 WATIR - WEB AUTOMATION TESTING IN RUBY

目录

4.1. Install of WATIR
4.1.1. IE
4.1.2. Firefox
4.1.3. Chrome Driver
4.2. watir-webdriver
4.3. Getting Started
4.3.1. firewatir
4.3.2. watir-webdriver
4.4. Config file
4.5. Watir library
4.6. Browser
4.6.1. Environment variable
4.6.2. Browser options
4.6.3. Open a browser (default: Internet Explorer)
4.6.4. Watir::Browser.attach
4.6.5. Open Browser at the specified URL
4.6.6. Go to a specified URL
4.6.7. Close the browser
4.6.8. 屏幕截图
4.7. Test Unit
4.8. HTML Tags and Watir Methods
4.8.1. Collections of HTML Elements

4.1. Install of WATIR

Install Ruby on Linux

sudo apt-get install ruby  # for Ubuntu / Debian users
sudo yum install ruby      # for Red Hat / Fedora users
		

Update RubyGems

sudo apt-get install rubygems # for Ubuntu / Debian users

sudo yum install rubygems # for Red Hat / Fedora users
		

Install Watir

gem update --system --no-rdoc --no-ri
gem install watir --no-rdoc --no-ri
		

4.1.1. IE

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535
			

4.1.2. Firefox

如果仅仅安装Firefox测试环境:

sudo gem install firewatir

Successfully installed firewatir-1.8.0
1 gem installed
Installing ri documentation for firewatir-1.8.0...
Installing RDoc documentation for firewatir-1.8.0...
			

JSSH for Firefox:

http://wiki.openqa.org/display/WTR/FireWatir+Installation

test jssh

$ firefox -jssh
$ telnet localhost 9997
			

4.1.3. Chrome Driver

http://code.google.com/p/chromium/downloads/list
@browser = Watir::Browser.new(:chrome)
@browser.goto "http://google.com"
			
comments powered by Disqus