Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira
Espremendo Melancia
Watir+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...
Who created Watir?
Watir is the creation
of people committed
to making testing easier
http://watir.com/team/
What is Watir?
● Is an open-source
● Family of Ruby libraries for automating web browsers
● Drives browsers the same way p...
Why Watir?
● There’s a very active and growing community behind it
● It uses Ruby, a full-featured modern scripting langua...
Why Watir?
● No find_element(s) === less code;
● Specific methods (divs, buttons, links…);
In Selenium: driver.find_elemen...
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...
● Action or text retrieval
○ click > PageObject.button
○ get text > PageObject.text_field
● Checks existence
○ PageObject....
example
class
script class
UI
elements
naming
update
script class
● Need run the several type
of browsers and versions
● How maintain the
infrastructure ?
Multi
Browser
Sauce Labs’ cloud testing
platform allows you to automatically
or interactively test mobile and
web applications on 300+ b...
example
Alex Warmling | alex@chaordic.com.br
Carlos Tadeu Panato Jr | tadeu@chaordic.com.br
Fausto Siqueira | siqueira@chaordic.co...
/chaordic.com.br
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
Próximos SlideShares
Carregando em…5
×

Espremendo melancia | TDC2014 Floripa | Chaordic

875 visualizações

Publicada em

Palestra feita no TDC2014 de Floripa

Publicada em: Tecnologia
0 comentários
2 gostaram
Estatísticas
Notas
  • Seja o primeiro a comentar

Sem downloads
Visualizações
Visualizações totais
875
No SlideShare
0
A partir de incorporações
0
Número de incorporações
18
Ações
Compartilhamentos
0
Downloads
13
Comentários
0
Gostaram
2
Incorporações 0
Nenhuma incorporação

Nenhuma nota no slide

Espremendo melancia | TDC2014 Floripa | Chaordic

  1. 1. Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira Espremendo Melancia Watir+PageObject
  2. 2. Automate your web browser beautifully, nicely and easily with some very sweet syntactic sugar.
  3. 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. 4. Who created Watir? Watir is the creation of people committed to making testing easier http://watir.com/team/
  5. 5. 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
  6. 6. 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
  7. 7. 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
  8. 8. Chaordic Mindset to write your Automated scripts Testing your script
  9. 9. example
  10. 10. ● Wireframe = Maps web UI elements ● Devs do homework = IDs ● QA creates a class (model) for the page ● Model will support testing ● DRY ● Easy API
  11. 11. ● 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
  12. 12. example class
  13. 13. script class
  14. 14. UI elements naming update
  15. 15. script class
  16. 16. ● Need run the several type of browsers and versions ● How maintain the infrastructure ? Multi Browser
  17. 17. 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
  18. 18. example
  19. 19. Alex Warmling | alex@chaordic.com.br Carlos Tadeu Panato Jr | tadeu@chaordic.com.br Fausto Siqueira | siqueira@chaordic.com.br
  20. 20. /chaordic.com.br

×