Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 102 lines (60 sloc) 2.652 kb
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
1 = Watir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
2
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
3 Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for automating web browsers. It supports your app no matter what technology it is developed in. They support Internet Explorer on Windows, Firefox and Chrome on Windows, Mac and Linux and Safari on Mac.
4
5 Project Home:: http://watir.com
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
6 Source Code:: http://github.com/bret/watir
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
7 Support:: http://watir.com/support
8 Gem:: https://rubygems.org/gems/watir
9 Gem:: https://rubygems.org/gems/firewatir
10 Gem:: https://rubygems.org/gems/commonwatir
0624361 @zeljkofilipin added experimental drivers
zeljkofilipin authored
11 Gem:: https://rubygems.org/gems/safariwatir
12 Gem:: https://rubygems.org/gems/watir-webdriver
13 Gem:: https://rubygems.org/gems/celerity
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
14
316c61e @zeljkofilipin changed titles from UPPER CASE to Title Case
zeljkofilipin authored
15 == Install
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
16
17 You have to install Ruby and RubyGems first. To be able to drive Firefox you have to install Firefox add-on. Detailed installation instructions are at http://watir.com/installation
18
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
19 === Windows
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
20
21 To install Internet Explorer and Firefox driver:
22
23 gem update --system
24 gem install watir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
25
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
26 === Mac
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
27
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
28 To install Firefox driver:
29
30 sudo gem update --system
31 sudo gem install firewatir
32
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
33 To install Safari driver, you have to install Xcode first and then:
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
34
35 sudo gem install rb-appscript
36 sudo gem install safariwatir
37
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
38 === Linux
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
39
40 To install Firefox driver:
41
42 sudo gem update --system
43 sudo gem install firewatir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
44
316c61e @zeljkofilipin changed titles from UPPER CASE to Title Case
zeljkofilipin authored
45 == Examples
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
46
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
47 Some examples from http://watir.com/examples
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
48
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
49 Loading Watir gem to drive Internet Explorer on Windows
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
50
51 require 'watir'
52
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
53 Loading FireWatir gem to drive Firefox on Windows/Mac/Linux
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
54
55 require 'firewatir'
56
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
57 Starting a new browser & and going to our site
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
58
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
59 browser = Watir::Browser.new
60 browser.goto("http://bit.ly/watir-example")
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
61
62 Setting a text field
63
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
64 browser.text_field(:name => "entry.0.single").set "Watir"
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
65
66 Setting a multi-line text box
67
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
68 browser.text_field(:name => "entry.1.single").set "I come here from Australia. \n The weather is great here."
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
69
70 Setting and clearing a radio button
71
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
72 browser.radio(:value => "Watir").set
73 browser.radio(:value => "Watir").clear
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
74
75 Setting and clearing check boxes
76
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
77 browser.checkbox(:value => "Ruby").set
78 browser.checkbox(:value => "Python").set
79 browser.checkbox(:value => "Python").clear
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
80
81 Clicking a button
82
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
83 browser.button(:name => "logon").click
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
84
85 Clearing, getting and selecting selection list values
86
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
87 browser.select_list(:name => "entry.6.single").clear
88 puts browser.select_list(:name => "entry.6.single").options
89 browser.select_list(:name => "entry.6.single").select "Chrome"
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
90
91 Clicking a button
92
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
93 browser.button(:name => "submit").click
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
94
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
95 Checking for text in a page
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
96
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
97 puts browser.text.include?("Your response has been recorded.")
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
98
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
99 Checking the title of a page
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
100
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
101 puts browser.title == "Thanks!"
Something went wrong with that request. Please try again.