Slide 1

Slide 1 text

Automated  Browser  Testing  with   Selenium  (and  PHPUnit) Joshua  Silver VP,  Product  Development  &  co-­‐founder Patientco

Slide 2

Slide 2 text

¡ Background ¡ Testing  at  Patientco ¡ Introduction  to  Selenium ¡ How  it  works  /  Getting  started ¡ Testing  in  the  cloud ¡ Next  Steps

Slide 3

Slide 3 text

¡ Patientco  helps  healthcare  providers  improve  all   aspects  of  patient  financial  engagement ¡ Billing,  payments,  healthcare  integrations ¡ Founded  in  2009 ¡ We’re  hiring! ¡ www.PatientcoLife.com

Slide 4

Slide 4 text

¡ Background: § CompSci from  GT § Helped  internationalize  CareerBuilder.com platform ¡ Technical  co-­‐founder  of  Patientco ¡ Fun  Fact:     § Travel  junkie:  25  countries  by  the  time  I  was  25

Slide 5

Slide 5 text

Develop  a  robust  payments  platform ….  that’s  cross  browser  compliant ….  that  ALWAYS  works ….  with  a  small  development  team ….  and  no  resources  for  QA

Slide 6

Slide 6 text

¡ Payment  processing § Heavy  client  side  logic § Lots  of  hairy  javascript ¡ Healthcare § COMPLEX  business  rules § Wide  variability  in  data ¡ Browsers

Slide 7

Slide 7 text

Hospital  Usage Patient  Usage

Slide 8

Slide 8 text

¡ Manual  QA

Slide 9

Slide 9 text

¡ Manual  QA

Slide 10

Slide 10 text

¡ Manual  QA ¡ Automated  testing § Unit  Testing § Integration  Testing § Full-­‐blown  front  end  testing

Slide 11

Slide 11 text

¡ All  critical  areas  of  the  site  (payment  processing,   registration,  etc.)    are  under  full  Selenium  test   coverage ¡ 2000+  tests ¡ 10,000s  of  distinct  test  cases (Most  tests  utilize  dataProviders to  test  various   cases  with  the  same  code) ¡ Run  end-­‐to-­‐end,  takes  many  hours.

Slide 12

Slide 12 text

Percent  Lines  of  Code Test  Code Application   Code

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

¡ Selenium  helps  you  automate  browser   based  tests  (with  recent  support  for  mobile) ¡ Write  one  test  and  run  in  all  browsers ¡ Script  complex  user  interactions,  including   AJAX,  dynamic  elements,  file  uploads,  etc. ¡ Invoked  through  PHPUnit tests

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

¡ Selenium  1  – Remote  Control  (RC) § Javascript layer  on  top  of  browser § Largely  procedural § DEPRECATED! ¡ Selenium  2  – WebDriver § Native/direct  calls  to  browser § Largely  OO § Allows  for  complex  interactions

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

1. Start  with  SeleniumBuilder https://saucelabs.com/builder 2. Export  test  results 3. Tweak  in  code: 1. Refactor  common  helper  functions 2. Add  dataProviders 3. Increase  number  of  asserts,  etc.

Slide 26

Slide 26 text

¡ Huge  array  of  testing  Browser/OS  platforms ¡ Manual  test  sessions ¡ Video  and  Screenshots ¡ Mobile  testing

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

¡ Start  small.  Test  something,  anything. ¡ Testing  should  never  be  a  separate  ticket.  It’s   a  STEP  in  a  development  ticket. ¡ Keep  an  eye  on  long  running  tests  and  try  to   consolidate  tests.   ¡ Track  which  areas  of  the  application  are   tested.

Slide 31

Slide 31 text

¡ Official  docs: § http://www.seleniumhq.org/docs/ ¡ Testing  in  the  cloud: § https://saucelabs.com § https://www.browserstack.com/ ¡ Go  test  something!

Slide 32

Slide 32 text

¡ With  Selenium,  you  can  automate  practically   anything! ¡ Selenium  provides  all  of  the  basic  building   blocks: § “Clicking”,  “typing”,  “dragging” § Capturing  data  elements § Conditional  logic  through  test  driver

Slide 33

Slide 33 text

http://xkcd.com/576/

Slide 34

Slide 34 text

Joshua  Silver [email protected] www.PatientcoLife.com

Slide 35

Slide 35 text

No content