Home | Mirror | Search

第 4 章 WATIR - WEB AUTOMATION TESTING IN RUBY

目錄

1. Install of WATIR
1.1. IE
1.2. Firefox
1.3. Chrome Driver
2. watir-webdriver
3. Getting Started
3.1. firewatir
3.2. watir-webdriver
4. Config file
5. Watir library
6. Browser
6.1. Environment variable
6.2. Browser options
6.3. Open a browser (default: Internet Explorer)
6.4. Watir::Browser.attach
6.5. Open Browser at the specified URL
6.6. Go to a specified URL
6.7. Close the browser
6.8. 屏幕截圖
7. Test Unit
8. HTML Tags and Watir Methods
8.1. Collections of HTML Elements

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
		

1.1. IE

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

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
			

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