1. Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira
Espremendo Melancia
Watir+PageObject
2. Automate your web browser
beautifully, nicely and
easily with some very sweet
syntactic sugar.
3. Agenda
● What is Watir?
● Benefits using Watir
● What is PageObject?
● Benefits using PageObject
● How to use
● Everything mixed with multi-browser?
● What is SauceLabs?
4.
5. Who created Watir?
Watir is the creation
of people committed
to making testing easier
http://watir.com/team/
6. What is Watir?
● Is an open-source
● Family of Ruby libraries for automating web browsers
● Drives browsers the same way people do
● No matter what technology it is developed in
7. Why Watir?
● There’s a very active and growing community behind it
● It uses Ruby, a full-featured modern scripting language
● It supports multiple browsers on different platforms
● It is powerful and easy to use, yet beautifully lightweight
● No test records (training wheels)
● No xpath selectors!
● Cucumber and Watir-WebDriver sitting in a tree
8. Why Watir?
● No find_element(s) === less code;
● Specific methods (divs, buttons, links…);
In Selenium: driver.find_element(:class, 'product-title')
In Watir: driver.div :class => ‘product-title’
● Explicit waits for AJAX (for Selenium :timeout => 10)
● JavaScript alerts
● Measure Page Performance
● Easy to work with iFrames
● PageObject
12. ● Wireframe = Maps web UI elements
● Devs do homework = IDs
● QA creates a class (model) for the
page
● Model will support testing
● DRY
● Easy API
13. ● Action or text retrieval
○ click > PageObject.button
○ get text > PageObject.text_field
● Checks existence
○ PageObject.button?
○ PageObject.div?
● Element return
○ PageObject.div_element
● Checkbox
○ check_active, uncheck_active, active_checked?
Acessors
auto
methods
19. ● Need run the several type
of browsers and versions
● How maintain the
infrastructure ?
Multi
Browser
20. Sauce Labs’ cloud testing
platform allows you to automatically
or interactively test mobile and
web applications on 300+ browsers
and platforms.
● Dont need maintain infrastructure
● Support for mobile testing
● Latest and old browsers versions
● Also can run JS Unit Tests