readme.rb in watir-1.4.1 vs readme.rb in watir-1.5.2
- old
+ new
@@ -1,105 +1,65 @@
=begin rdoc
This is Watir - Web Application Testing In Ruby http://wtr.rubyforge.org
-To Install:
- Execute install.rb.
+To Install Ruby: http://ruby-lang.org
+ Best is to use Ruby 1.8.2-14 or later.
+ However, if you are using the Watir::IE#modal_dialog method, you must use Ruby 1.8.2-14 and not a more recent version.
+ Watir (in general) will not work with Ruby 1.8.1-13. (This version of Ruby has a bad WIN32OLE library.)
+To Install Watir:
+ Best way to install is to use the gem.
+ From your command line:
+ > gem install win32-process --include-dependencies
+ > gem install watir
+ This will download and install watir, win32-process and all dependencies.
+
How To Use:
- This only works on Windows. It has been tested on Windows 2000 and XP.
- Best is to use Ruby 1.8.2-14 or later.
- This has been developed and tested using Ruby 1.8.1-11, Ruby 1.8.1-12.
- It will NOT work with Ruby 1.8.1-13. (This version of Ruby has a bad WIN32OLE library.)
+ This only works on Windows.
Requires Internet Explorer 5.5 or newer.
Check out the mail lists and the documentation for the workarounds.
- Install ruby from http://ruby-lang.org
+User Guide: http://wiki.openqa.org/display/WTR/User+Guide
+
Unit Tests:
Run the unittests in a cmd shell. Go to the dir where you installed it and then type 'ruby unittests/core_tests.rb'.
See the user guide if you are having problems with security blocking.
-Changes in 1.4.1
- (based on watir.rb revision 1.215)
- removed annoying warning message that sometimes appeared
- corrected Element#class_name references which has been misnamed Element#style
- removed IE#capture_events (didn't really work)
- added IE#bring_to_front and IE#front?
- fixed failing frame tests
- remove failing test for disabled images
- better rdoc
-
-Changes in 1.4.0
- fix method name for accessing class name of P/Span/Div (change from style to class_name)
- fix for bug 2152 (frame index in show_frames off by 1)
- added alt as a property to image
- added file_fields
- fixed TextArea#to_s
- moved reset button to buttons class
- add IE#send_keys
- frames can now be referenced using regexps and ids
- added IE#minimize, IE#maximize, IE#restore
- onChange and onBlur events now triggered by TextField#set
- added default option to set for checkbox
- added colspan method to tablecell
- fix for bug reported by Scott P, wrong objects are sometimes found
- fixed bug with radio/checkboxes doing multiple fireevents
- fix for table, id and reg exp
- wait for page load before returning from IE.attach
- update to select_list -- new interface still in progress
- added .show method to iterators
- fix for flashing objects in table cells
- added flash for forms
- flash returns nil instead of the curious '10'
- removed ScreenCapture module from IE class
-
-Changes in 1.3.1
- Added P tag support
- Bug fix for images and links in frames using each
- Bug fixes for image#save
-
-Changes in 1.3
- added new row_values and column_value methods to tables
- added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif')
- new method, html that applies to objects, not just a page - ie.button(:index,1).html => <INPUT id=b2 title="this is button1" onclick="javascript:document.location='pass.html';" type=button value="Click Me" name=b1>
- now throws a NavigationException on 404, 500 errors
- iterators now mixin Enumerable
- added support for labels
- added support for frames by index
- added screen_capture
- added hidden field support, and iterator method
- table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click
- added index to print out from show_xx methods. Link shows img src if an image is used
- added onKeyUp and onKeyDown to text_fields#set
- installer now installs AutoIt to deal with javascript popups, file uploads etc
- the spinner is now off by default
- bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields
- bug fix for flash for tables
- bug fixes for images and links in cells
-
Typical Usage
# include the controller
require 'watir'
# create an instance of the controller
ie = Watir::IE.new
# go to the page you want to test
- ie.goto("http://myserver/mypage")
- # to enter text into a text field - assuming the field is name "username"
- ie.text_field(:name, "username").set("Paul")
- # if there was a text field that had an id of "company_ID", you could set it to Ruby Co:
- ie.text_field(:id ,"company_ID").set("Ruby Co")
+ ie.goto('http://myserver/mypage')
+ # to enter text into a text field - assuming the field is named 'username'
+ ie.text_field(:name, 'username').set('Paul')
+ # if there was a text field that had an id of 'company_ID', you could set it to 'Ruby Co':
+ ie.text_field(:id ,'company_ID').set('Ruby Co')
# to click a button that has a caption of 'Cancel'
- ie.button(:value, "Cancel").click
+ ie.button(:value, 'Cancel').click
+
+ Identifying something using two or more identifying characteristics
+ # Html objects can also be identified via a combination of two of the above methods,
+ # for example to click a span with a class name of 'Label', and whose text is 'Add new', one could say
+ ie.span(:class =>'Label', :text => 'Add new').click
+ # Or to find one object within another (for example the first text_field within a div of class
+ # 'PasswordInput', where your password equals 'MyPassword'), one could say
+ ie.div(:class, 'PasswordInput').text_field(:index, 1).set('MyPassword')
The ways that are available to identify an html object depend upon the object type, but include
- :id used for an object that has an ID attribute -- this is the best way!
- :name used for an object that has a name attribute.
- :value value of text fields, captions of buttons
+ :id used for an object that has an ID attribute.*
+ :name used for an object that has a name attribute.*
+ :value value of text fields, captions of buttons.
:index finds the nth object of the specified type - eg button(:index , 2) finds the second button. This is 1 based. <br>
- :beforeText finds the object immeditaley before the specified text. Doesnt work if the text is in a table cell
- :afterText finds the object immeditaley after the specified text. Doesnt work if the text is in a table cell
+ :class used for an object that has a class attribute.
+ :text used for links and other objects that contain text.
+ :xpath finds the item using xpath query
+ * :id and :name are the quickest of these to process, and so should be used when possible to speed up scripts.
+
The objects that are currently supported include
Button
Radio
CheckBox
TextField (Including TextArea and Password)
@@ -119,22 +79,22 @@
Command line options:
-b (background) Run Internet Explorer invisible
-f (fast) Run tests very fast
- -x (spinner) Add a spinner that displays when pages are waiting to be loaded.
Note that if you also use test/unit, you will need to require 'watir' first to avoid conflicts
with its command line switches.
Javascript Pop Up Support
- Watir now installs AutoIt - http://www.autoitscript.com/
- This is the preffered method for dealing with pop ups, file requesters etc. Support for Winclickers will be removed.
+ Watir now optionally installs AutoIt - http://www.autoitscript.com/
+ This is the prefered method for dealing wth pop ups, file requesters etc. Support for Winclickers will be removed.
Contacts:
Paul Rogers (paul.rogers@shaw.ca)
Bret Pettichord (bret@pettichord.com)
+ Charley Baker (charley.baker@gmail.com)
The mailing list: http://rubyforge.org/mail/?group_id=104
Contributors:
Bret Pettichord
Paul Rogers
@@ -144,68 +104,43 @@
Lorenzo Jorquera
Atilla Ozgur
Justin McCarthy
Chris McMahon
Elisabeth Hendrickson
- Michael Kelly (Indianapolis)
+ Michael Kelly
Peter Chau
- Jacinda Scott
Danny Faught
Andy Sipe
John Lloyd-Jones
Chris Hedges
Park Heesob
Shashank Date
Jared Luxenberg
Alexey Verkhovsky
Tuyet Cong-Ton-Nu
- Kingsley Hendrickse
+ Jeff Wood
+ Angrez Singh
+ Abhishek Goliya
+ Yaxin Wang
+ Michael Bolton
+ Paul Carvalho
+ Konstantin Sobolev
+ David Schmidt
+ Dara Lillis
+ Charley Baker
+ Prema Arya
+ Xavier Noria
+ Jeff Fry
+ Zeljko Filipin
Acknowledgements:
Chris Morris
Brian Marick
Jonathan Kohl
Penny Tonita
Janet Gregory
Andy Tinkham
+ Jacinda Scott (logo creator)
Thanks for your ideas and support!
-License
- ---------------------------------------------------------------------------
- Copyright (c) 2004-2005, Paul Rogers and Bret Pettichord
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the names Paul Rogers, Bret Pettichord nor the names of contributors to
- this software may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
- IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- --------------------------------------------------------------------------
- (based on BSD Open Source License)
-
-
-
-
=end
-class ReadMe
-end
\ No newline at end of file