Professional Documents
Culture Documents
Sumanth Krishna. A
www.sumanthkrishna.com
Agenda
Introducing the topic
Discussion on Testing frameworks/tools and
it’s necessity
Ruby
Installations
Architecture
Testcases
Scope
TAG CLOUD
ruby Apache Nginx assertions
FF
DOM
Automation
Interface FireWatir/Ruby
Browser Support
Watir API
Test Script
Installing: Windows
Install Ruby: Use the Ruby one-click installer for windows
Install the latest gem watir (ruby packages are called gems)
gem install watir
And you find the following gems installing…
Successfully installed xml-simple-1.0.11
Successfully installed s4t-utils-1.0.4
Successfully installed builder-2.1.2
Successfully installed user-choices-1.1.6
Successfully installed commonwatir-1.6.2
Successfully installed firewatir-1.6.2 (to support Firefox)
Successfully installed watir-1.6.2
Successfully installed win32-api-1.3.0-x86-mswin32-60
Successfully installed windows-api-0.3.0
Successfully installed rubyforge-1.0.2
10 gems installed
Installation done… let’s move ahead
What Next?
Since we are here to test the web-
application
Navigate the browser?
Find elements on the page?
Interact with elements on the page?
Check output on the page?
Create and use Methods?
Create formal test cases?
Step by Step
Navigate to the browser
#Always Load the Watir library at the top of
your script
require ‘watir’
Start IE and navigate to a given/different
URL
IE = Watir::IE.start(‘http://www.qvnatel.com’)
IE.goto(“http://free-
opensource.qvantel.net/mediawiki//index.php
/Main_Page ”)
IE.close
Finding <HTML> Elements
TextBox IE.text_field(how, what)
Button IE.button(how, what)
DropDownList IE.select_list(how, what)
CheckBox IE.checkbox(how, what)
#Test cases are contained within classes which extend Ruby’s base test case class
class MyTest < Test::Unit::TestCase
def setup #Optional, will be run before each test method.
@ie = login() #call our login function.
end
ie = Watir::IE.new
Scope
Using Watir for all web applications
Integrate it with Automation/Building
process
Watir
References
Wikipedia: http://en.wikipedia.org/wiki/Watir
Watir main site: http://wiki.openqa.org/display/WTR/
Watir user guide: wtr.rubyforge.org/watir_user_guide.html
Watir API: wtr.rubyforge.org/rdoc/index.html
Mailing List: rubyforge.org/mailman/listinfo/wtr-general
Project site: http://wiki.openqa.org/display/WTR/
User Contributions/examples:
http://wiki.openqa.org/display/WTR/Contributions
Watir FAQ: http://wiki.openqa.org/display/WTR/FAQ
Watir Recorder
http://www.hanselman.com/blog/IntroducingWatirMakerRecordingForRubybasedW
http://www.hanselman.com/blog/NewReleaseOfWatirMakerNowWatirRecorder.
aspx
FireWatir
Source: http://code.google.com/p/firewatir/wiki/Firewatir
Ruby
Ruby site: http://ruby-lang.org
Ruby docs: http://ruby-doc.org/
Ruby Quickstart: ruby-lang.org/en/documentation/quickstart/
Thanks
tosumanthkrishna@gmail.com
www.sumanthkrishna.com