Espremendo melancia | TDC2014 Floripa | Chaordic

23
Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira Espremendo Melancia Watir+PageObject

description

Palestra feita no TDC2014 de Floripa

Transcript of Espremendo melancia | TDC2014 Floripa | Chaordic

Page 1: Espremendo melancia | TDC2014 Floripa | Chaordic

Alex Warmling | Carlos Tadeu Panato Jr | Fausto Siqueira

Espremendo MelanciaWatir+PageObject

Page 2: Espremendo melancia | TDC2014 Floripa | Chaordic

Automate your web browser beautifully, nicely and

easily with some very sweet syntactic sugar.

Page 3: Espremendo melancia | TDC2014 Floripa | Chaordic

Agenda

● What is Watir?

● Benefits using Watir

● What is PageObject?

● Benefits using PageObject

● How to use

● Everything mixed with multi-browser?

● What is SauceLabs?

Page 4: Espremendo melancia | TDC2014 Floripa | Chaordic
Page 5: Espremendo melancia | TDC2014 Floripa | Chaordic

Who created Watir?

Watir is the creationof people committed

to making testing easierhttp://watir.com/team/

Page 6: Espremendo melancia | TDC2014 Floripa | Chaordic

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

Page 7: Espremendo melancia | TDC2014 Floripa | Chaordic

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

Page 8: Espremendo melancia | TDC2014 Floripa | Chaordic

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

Page 9: Espremendo melancia | TDC2014 Floripa | Chaordic

Chaordic Mindset to write your Automated scripts

Testing your script

Page 10: Espremendo melancia | TDC2014 Floripa | Chaordic

example

Page 11: Espremendo melancia | TDC2014 Floripa | Chaordic
Page 12: Espremendo melancia | TDC2014 Floripa | Chaordic

● Wireframe = Maps web UI elements

● Devs do homework = IDs

● QA creates a class (model) for the

page

● Model will support testing

● DRY

● Easy API

Page 13: Espremendo melancia | TDC2014 Floripa | Chaordic

● 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

Page 14: Espremendo melancia | TDC2014 Floripa | Chaordic

exampleclass

Page 15: Espremendo melancia | TDC2014 Floripa | Chaordic

script class

Page 16: Espremendo melancia | TDC2014 Floripa | Chaordic

UI elements naming update

Page 17: Espremendo melancia | TDC2014 Floripa | Chaordic

script class

Page 18: Espremendo melancia | TDC2014 Floripa | Chaordic
Page 19: Espremendo melancia | TDC2014 Floripa | Chaordic

● Need run the several type of browsers and versions

● How maintain the infrastructure ?

MultiBrowser

Page 20: Espremendo melancia | TDC2014 Floripa | Chaordic

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

Page 21: Espremendo melancia | TDC2014 Floripa | Chaordic

example

Page 22: Espremendo melancia | TDC2014 Floripa | Chaordic

Alex Warmling | [email protected] Tadeu Panato Jr | [email protected] Siqueira | [email protected]

Page 23: Espremendo melancia | TDC2014 Floripa | Chaordic

/chaordic.com.br