SlideShare a Scribd company logo
Automated Testing with WATIR Timothy Fisher
What is WATIR? W eb  A pplication  T esting  I n  R uby  Open-source Framework for browser-based automated testing. Test scripts written in the Ruby programming language. Natively supports IE Extensions support Firefox and Safari Pronounced like “water”
Why use WATIR? Ideal for functional or integration level testing. Full power of Ruby available in test scripts. Find bugs that unit tests miss. Automates what is usually a manual tedious process. More to come…
WATIR Testimonials A few testimonials from WATIR website: watir rules. It easily outperformed every other automation tool we evaluated… the most useful piece of software I’ve ever evaluated… watir is by far the most complete web testing framework out there… Watir is the most compelling alternative for filling the automated acceptance test need. (Ward Cunningham) With watir, we are able to test with ease and ship with confidence. And last but not least: watir blew my freakin mind.  Everything worked, no fuss, no muss, no bother. I’m so happy to discover Ruby and Watir.  I wanted to run around my office dancing and celebrating.
WATIR Examples ie.link(:id, “lnk1”).click ie.button(:id, “btn1”).click ie.link(:name, “lnk1”).exists? ie.contains_text(‘Welcome’) wait_until {@browser.contains_text “Edit"} WATIR can find elements by id, name, text, link, XPath, etc… WATIR uses the OLE/COM automation interface to control the browser.
Creating a Test DSL with WATIR What is a DSL? Domain Specific Language a language designed for a specific domain Testing DSL A language design specifically for browser-based testing.
Test Framework Test Scripts App Specific Test DSL WATIR Test Framework Ruby run-time
Test Script Example launch_myapp ENVIRONMENT, :port=>PORT login_as USERNAME, PASSWORD goto_page :configuration select_tab :partners add_new_partner :label=>'TestPartner'  save_configuration Test Scripts
DSL Example def login_as(user, password) # enter user name and password @browser.text_field(:name, 'member_name').set(user) @browser.text_field(:name,'member_password').set(password) # submit login form @browser.form(:id, 'formLogin').submit  @browser.wait # verify you have reached the welcome page assert @browser.contains_text("Catalog Data Quick Overview") puts "Successfully logged in." end Test Scripts App Specific Test DSL
Observations Test scripts use very simple application targeted language. Only DSL implementation uses WATIR API With training QA could write test scripts.
Test Scripts Everywhere… Test scripts can be written before development. practice test-driven development. embed in Use Cases to achieve testable use cases, executable specifications. Defects can be described using a Test Script that reproduces the defect. attach script to bugzilla defect.
Recording Scripts Watir Recorder++ Firewatir Recorder Records user action while user is interacting with the application User TestGen4Web XPI for capturing user actions Convert user actions to XML Convert XML to ruby file for playback using tg4rb gem
WATIR Alternatives Selenium Similar open source browser automation framework. Scripts are written in custom macro language. Commercial Products Compuware TestPartner Usually based on record-playback techniques
References Watir http://wtr.rubyforge.org   Firewatir  http://code.google.com/p/firewatir tg4rb  http://code.google.com/p/tg4rb TestGen4Web http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web Selenium http://www.openqa.org/selenium/   Compuware TestPartner http://www.compuware.com/products/qacenter/375_ENG_HTML.htm

More Related Content

What's hot (20)

PPTX
UI Web Development.pptx
SHAIKIRFAN715544
 
PPTX
Progressive Web App
SaleemMalik52
 
PDF
Amazon API Gateway
Mark Bate
 
PPTX
Ola cabs
ARSHIYA KHAN
 
PDF
Progressive Web Apps / GDG DevFest - Season 2016
Abdelrahman Omran
 
PPTX
Business analytics in Zomato food chain
Adithya Hegde
 
PDF
Full Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Ichsan Rahardianto
 
ODP
Introduction to Progressive Web Apps (PWA)
Sandip Nirmal
 
PPTX
Introduction to Apache Cordova (Phonegap)
ejlp12
 
PDF
Introduction to WebSockets
Gunnar Hillert
 
PPTX
An Introduction To REST API
Aniruddh Bhilvare
 
PPTX
mendix.ppt sateesh.pptx
pICHUKULABHUVANASATE
 
PPTX
Business Model Canvas of Ola Cabs by Akshay Nahar
Akshay nahar
 
PPTX
Flutter workshop
Vishnu Suresh
 
PPTX
Pwa.pptx
Harish Karthick
 
PDF
Introduction to Mobile Application Development
Tharindu Dassanayake
 
PDF
What is Appium? Edureka
Edureka!
 
PDF
Introduction To Mobile-Automation
Mindfire Solutions
 
PPTX
Food Delivery App Development company.pptx
Smith Daniel
 
PDF
What is Google App Engine
Chris Schalk
 
UI Web Development.pptx
SHAIKIRFAN715544
 
Progressive Web App
SaleemMalik52
 
Amazon API Gateway
Mark Bate
 
Ola cabs
ARSHIYA KHAN
 
Progressive Web Apps / GDG DevFest - Season 2016
Abdelrahman Omran
 
Business analytics in Zomato food chain
Adithya Hegde
 
Full Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Ichsan Rahardianto
 
Introduction to Progressive Web Apps (PWA)
Sandip Nirmal
 
Introduction to Apache Cordova (Phonegap)
ejlp12
 
Introduction to WebSockets
Gunnar Hillert
 
An Introduction To REST API
Aniruddh Bhilvare
 
mendix.ppt sateesh.pptx
pICHUKULABHUVANASATE
 
Business Model Canvas of Ola Cabs by Akshay Nahar
Akshay nahar
 
Flutter workshop
Vishnu Suresh
 
Pwa.pptx
Harish Karthick
 
Introduction to Mobile Application Development
Tharindu Dassanayake
 
What is Appium? Edureka
Edureka!
 
Introduction To Mobile-Automation
Mindfire Solutions
 
Food Delivery App Development company.pptx
Smith Daniel
 
What is Google App Engine
Chris Schalk
 

Viewers also liked (9)

PPT
Introduction To Ruby Watir (Web Application Testing In Ruby)
Mindfire Solutions
 
PDF
Cucumber Ru09 Web
Joseph Wilk
 
PPT
What you can do In WatiR
Wesley Chen
 
PPT
Watir Presentation Sumanth Krishna. A
Sumanth krishna
 
PDF
watir-webdriver
jariba
 
DOC
Selenium Automation Using Ruby
Kumari Warsha Goel
 
PPT
Keyword Driven Framework using WATIR
Nivetha Padmanaban
 
PDF
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
PDF
Automated Testing with Ruby
Keith Pitty
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Mindfire Solutions
 
Cucumber Ru09 Web
Joseph Wilk
 
What you can do In WatiR
Wesley Chen
 
Watir Presentation Sumanth Krishna. A
Sumanth krishna
 
watir-webdriver
jariba
 
Selenium Automation Using Ruby
Kumari Warsha Goel
 
Keyword Driven Framework using WATIR
Nivetha Padmanaban
 
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
Automated Testing with Ruby
Keith Pitty
 
Ad

Similar to Automated Testing With Watir (20)

PPT
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Sla Va
 
PPTX
Test Automation using Ruby
Sla Va
 
PPTX
Watir - The Beginning
Andrii Dzynia
 
PPTX
Watir The Beginning
automated-testing.info
 
PPT
Fire Watir Script Generator Barcamp
angrez
 
PPTX
Cross Browser Automation Testing Using Watir
Sarah Elson
 
PPT
FireWatir - Web Application Testing Using Ruby and Firefox
angrez
 
PPT
watir-webdriver
Amit DEWAN
 
PPT
No Va Taig April 7 2010
rudy regner
 
PPT
Jonas Skjoldan - Automatic GUI test with Ruby and Watir
TEST Huddle
 
PPTX
Page object from the ground up.ppt
Joseph Beale
 
PPTX
Page object from the ground up by Joe Beale
QA or the Highway
 
PPTX
Андрей Дзыня - "Watir - начало"
QA Dnepropetrovsk Community (Ukraine)
 
PDF
Sinatra and JSONQuery Web Service
vvatikiotis
 
PPTX
Making Watir and Cucumber an efficient tool for Web UI Automation
Ruslan Strazhnyk
 
PPTX
Cucumber From the Ground Up - Joseph Beale
QA or the Highway
 
PDF
Automation Open Source tools
QA Club Kiev
 
PDF
full-stack-webapp-testing-with-selenium-and-rails.pdf
Brian Takita
 
PPT
Whats In Your QA Tool Belt?
Walter Mamed
 
PDF
Espremendo melancia | TDC2014 Floripa | Chaordic
Carlos Tadeu Panato Junior
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Sla Va
 
Test Automation using Ruby
Sla Va
 
Watir - The Beginning
Andrii Dzynia
 
Watir The Beginning
automated-testing.info
 
Fire Watir Script Generator Barcamp
angrez
 
Cross Browser Automation Testing Using Watir
Sarah Elson
 
FireWatir - Web Application Testing Using Ruby and Firefox
angrez
 
watir-webdriver
Amit DEWAN
 
No Va Taig April 7 2010
rudy regner
 
Jonas Skjoldan - Automatic GUI test with Ruby and Watir
TEST Huddle
 
Page object from the ground up.ppt
Joseph Beale
 
Page object from the ground up by Joe Beale
QA or the Highway
 
Андрей Дзыня - "Watir - начало"
QA Dnepropetrovsk Community (Ukraine)
 
Sinatra and JSONQuery Web Service
vvatikiotis
 
Making Watir and Cucumber an efficient tool for Web UI Automation
Ruslan Strazhnyk
 
Cucumber From the Ground Up - Joseph Beale
QA or the Highway
 
Automation Open Source tools
QA Club Kiev
 
full-stack-webapp-testing-with-selenium-and-rails.pdf
Brian Takita
 
Whats In Your QA Tool Belt?
Walter Mamed
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Carlos Tadeu Panato Junior
 
Ad

More from Timothy Fisher (6)

PPTX
Social Media Startup Guide
Timothy Fisher
 
KEY
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
PDF
JQuery 101
Timothy Fisher
 
PDF
Developing High Performance Web Apps
Timothy Fisher
 
PDF
HTML5 New and Improved
Timothy Fisher
 
PPT
Getting Social with OpenSocial
Timothy Fisher
 
Social Media Startup Guide
Timothy Fisher
 
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
JQuery 101
Timothy Fisher
 
Developing High Performance Web Apps
Timothy Fisher
 
HTML5 New and Improved
Timothy Fisher
 
Getting Social with OpenSocial
Timothy Fisher
 

Recently uploaded (20)

PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 

Automated Testing With Watir

  • 1. Automated Testing with WATIR Timothy Fisher
  • 2. What is WATIR? W eb A pplication T esting I n R uby Open-source Framework for browser-based automated testing. Test scripts written in the Ruby programming language. Natively supports IE Extensions support Firefox and Safari Pronounced like “water”
  • 3. Why use WATIR? Ideal for functional or integration level testing. Full power of Ruby available in test scripts. Find bugs that unit tests miss. Automates what is usually a manual tedious process. More to come…
  • 4. WATIR Testimonials A few testimonials from WATIR website: watir rules. It easily outperformed every other automation tool we evaluated… the most useful piece of software I’ve ever evaluated… watir is by far the most complete web testing framework out there… Watir is the most compelling alternative for filling the automated acceptance test need. (Ward Cunningham) With watir, we are able to test with ease and ship with confidence. And last but not least: watir blew my freakin mind. Everything worked, no fuss, no muss, no bother. I’m so happy to discover Ruby and Watir. I wanted to run around my office dancing and celebrating.
  • 5. WATIR Examples ie.link(:id, “lnk1”).click ie.button(:id, “btn1”).click ie.link(:name, “lnk1”).exists? ie.contains_text(‘Welcome’) wait_until {@browser.contains_text “Edit"} WATIR can find elements by id, name, text, link, XPath, etc… WATIR uses the OLE/COM automation interface to control the browser.
  • 6. Creating a Test DSL with WATIR What is a DSL? Domain Specific Language a language designed for a specific domain Testing DSL A language design specifically for browser-based testing.
  • 7. Test Framework Test Scripts App Specific Test DSL WATIR Test Framework Ruby run-time
  • 8. Test Script Example launch_myapp ENVIRONMENT, :port=>PORT login_as USERNAME, PASSWORD goto_page :configuration select_tab :partners add_new_partner :label=>'TestPartner' save_configuration Test Scripts
  • 9. DSL Example def login_as(user, password) # enter user name and password @browser.text_field(:name, 'member_name').set(user) @browser.text_field(:name,'member_password').set(password) # submit login form @browser.form(:id, 'formLogin').submit @browser.wait # verify you have reached the welcome page assert @browser.contains_text("Catalog Data Quick Overview") puts "Successfully logged in." end Test Scripts App Specific Test DSL
  • 10. Observations Test scripts use very simple application targeted language. Only DSL implementation uses WATIR API With training QA could write test scripts.
  • 11. Test Scripts Everywhere… Test scripts can be written before development. practice test-driven development. embed in Use Cases to achieve testable use cases, executable specifications. Defects can be described using a Test Script that reproduces the defect. attach script to bugzilla defect.
  • 12. Recording Scripts Watir Recorder++ Firewatir Recorder Records user action while user is interacting with the application User TestGen4Web XPI for capturing user actions Convert user actions to XML Convert XML to ruby file for playback using tg4rb gem
  • 13. WATIR Alternatives Selenium Similar open source browser automation framework. Scripts are written in custom macro language. Commercial Products Compuware TestPartner Usually based on record-playback techniques
  • 14. References Watir http://wtr.rubyforge.org Firewatir http://code.google.com/p/firewatir tg4rb http://code.google.com/p/tg4rb TestGen4Web http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web Selenium http://www.openqa.org/selenium/ Compuware TestPartner http://www.compuware.com/products/qacenter/375_ENG_HTML.htm