Skip to content
Newer
Older
100644 106 lines (62 sloc) 2.84 KB
acf0131 @jamesgpearce Update README.rdoc
jamesgpearce authored
1 = Archived Repo
2
3 This is an archived fork and is no longer supported or updated by Facebook. Please do not file issues or pull-requests against this repo. The primary on-going source of the project may now be found at https://github.com/watir/watir-classic
4
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
5 = Watir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
6
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
7 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.
8
9 Project Home:: http://watir.com
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
10 Source Code:: http://github.com/bret/watir
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
11 Support:: http://watir.com/support
12 Gem:: https://rubygems.org/gems/watir
13 Gem:: https://rubygems.org/gems/firewatir
14 Gem:: https://rubygems.org/gems/commonwatir
0624361 @zeljkofilipin added experimental drivers
zeljkofilipin authored
15 Gem:: https://rubygems.org/gems/safariwatir
16 Gem:: https://rubygems.org/gems/watir-webdriver
17 Gem:: https://rubygems.org/gems/celerity
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
18
316c61e @zeljkofilipin changed titles from UPPER CASE to Title Case
zeljkofilipin authored
19 == Install
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
20
21 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
22
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
23 === Windows
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
24
25 To install Internet Explorer and Firefox driver:
26
27 gem update --system
28 gem install watir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
29
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
30 === Mac
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
31
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
32 To install Firefox driver:
33
34 sudo gem update --system
35 sudo gem install firewatir
36
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
37 To install Safari driver, you have to install Xcode first and then:
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
38
39 sudo gem install rb-appscript
40 sudo gem install safariwatir
41
aa7a079 @zeljkofilipin improved formatting
zeljkofilipin authored
42 === Linux
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
43
44 To install Firefox driver:
45
46 sudo gem update --system
47 sudo gem install firewatir
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
48
316c61e @zeljkofilipin changed titles from UPPER CASE to Title Case
zeljkofilipin authored
49 == Examples
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
50
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
51 Some examples from http://watir.com/examples
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
52
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
53 Loading Watir gem to drive Internet Explorer on Windows
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
54
55 require 'watir'
56
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
57 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
58
59 require 'firewatir'
60
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
61 Starting a new browser & and going to our site
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
62
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
63 browser = Watir::Browser.new
64 browser.goto("http://bit.ly/watir-example")
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
65
66 Setting a text field
67
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
68 browser.text_field(:name => "entry.0.single").set "Watir"
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
69
70 Setting a multi-line text box
71
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
72 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
73
74 Setting and clearing a radio button
75
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
76 browser.radio(:value => "Watir").set
77 browser.radio(:value => "Watir").clear
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
78
79 Setting and clearing check boxes
80
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
81 browser.checkbox(:value => "Ruby").set
82 browser.checkbox(:value => "Python").set
83 browser.checkbox(:value => "Python").clear
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
84
85 Clicking a button
86
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
87 browser.button(:name => "logon").click
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
88
89 Clearing, getting and selecting selection list values
90
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
91 browser.select_list(:name => "entry.6.single").clear
92 puts browser.select_list(:name => "entry.6.single").options
93 browser.select_list(:name => "entry.6.single").select "Chrome"
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
94
95 Clicking a button
96
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
97 browser.button(:name => "submit").click
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 for text in a page
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
100
110abca @jarmo fixed README. Closes http://jira.openqa.org/browse/WTR-461
jarmo authored
101 puts browser.text.include?("Your response has been recorded.")
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
102
71cf82b @zeljkofilipin updated README file
zeljkofilipin authored
103 Checking the title of a page
6a4b19b @marekj more rdoc info to README as landing page for gem rdoc
marekj authored
104
9140844 @zeljkofilipin updated examples:
zeljkofilipin authored
105 puts browser.title == "Thanks!"
Something went wrong with that request. Please try again.