espremendo melancia | tdc2014 floripa | chaordic
DESCRIPTION
Palestra feita no TDC2014 de FloripaTRANSCRIPT
Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira
Espremendo MelanciaWatir+PageObject
Automate your web browser beautifully, nicely and
easily with some very sweet syntactic sugar.
Agenda
● What is Watir?
● Benefits using Watir
● What is PageObject?
● Benefits using PageObject
● How to use
● Everything mixed with multi-browser?
● What is SauceLabs?
Who created Watir?
Watir is the creationof people committed
to making testing easierhttp://watir.com/team/
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
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
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
Chaordic Mindset to write your Automated scripts
Testing your script
example
● Wireframe = Maps web UI elements
● Devs do homework = IDs
● QA creates a class (model) for the
page
● Model will support testing
● DRY
● Easy API
● 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?
Acessorsauto methods
exampleclass
script class
UI elements naming update
script class
● Need run the several type of browsers and versions
● How maintain the infrastructure ?
MultiBrowser
Sauce Labs’ cloud testingplatform 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
example
Alex Warmling | [email protected] Tadeu Panato Jr | [email protected] Siqueira | [email protected]
/chaordic.com.br