the what, why and how of web analytics testing

37
The What, Why & How of Web Analy3cs Tes3ng Anand Bagmar So#ware Quality Evangelist Principal Consultant, ThoughtWorks

Upload: anand-bagmar

Post on 10-May-2015

2.824 views

Category:

Technology


1 download

DESCRIPTION

Slides from my talk in UNICOM's Next Generation Testing Conference on 13th December in Bangalore on "The What, Why and How of Web Analytics Testing". This is based on my open-source tool - WAAT. More information about the talk is available here: http://goo.gl/FxISG Information about WAAT is available here: http://goo.gl/oUNHU

TRANSCRIPT

Page 1: The what, why and how of web analytics testing

The  What,  Why  &  How  of    

Web  Analy3cs  Tes3ng  

Anand  Bagmar  So#ware  Quality  Evangelist  

Principal  Consultant,  ThoughtWorks  

Page 2: The what, why and how of web analytics testing

Why  do  we  do  Tes3ng?  

Page 3: The what, why and how of web analytics testing

What  is  Web  Analy3cs?  

Page 4: The what, why and how of web analytics testing

Why  do  we  need  it?  

Page 5: The what, why and how of web analytics testing

Web  Analy*cs  Solu*on  Providers  

Adobe  Marke*ng  Cloud  /  Omniture  

SiteCatalyst  

WebTrends  

AWStats  

Google  Analy*cs  

StatCounter  

…  

Page 6: The what, why and how of web analytics testing

How  to  test  Web  Analy3cs?  

Page 7: The what, why and how of web analytics testing

The  end  report  

Page 8: The what, why and how of web analytics testing
Page 9: The what, why and how of web analytics testing
Page 10: The what, why and how of web analytics testing

Pros  

•  Ensure  report  is  setup  correctly    

Cons  •  Licensing  •  Reports  not  yet  setup  •  Validate  all  requests  are  sent  /  captured  

Tes3ng  at  the  report  level  

Page 11: The what, why and how of web analytics testing

At  the  origin!  

Page 12: The what, why and how of web analytics testing
Page 13: The what, why and how of web analytics testing
Page 14: The what, why and how of web analytics testing

The  problem  

Page 15: The what, why and how of web analytics testing

Manual  

Page 16: The what, why and how of web analytics testing

The  challenge  

Page 17: The what, why and how of web analytics testing

Repea3ng  over-­‐and-­‐over  again  

Page 18: The what, why and how of web analytics testing
Page 19: The what, why and how of web analytics testing

The  solu3on  

Page 20: The what, why and how of web analytics testing

What  does  WAAT  do  for  me?  

• Minimal  changes  to  exisFng  test  framework    •  Does  not  depend  on  junit  /  testng  /  …  • Web  AnalyFc  tool  independent  •  UI  Driver  framework  independent  •  Browser  independent  

Page 21: The what, why and how of web analytics testing

Flavors  

Page 22: The what, why and how of web analytics testing

Architecture  

Page 23: The what, why and how of web analytics testing

•  Original  flavor  •  Source  code  +  jar    •  Supports  3  plugins    •  Omniture  Debugger  

•  HUpSniffer  •  JsSniffer  

•  Available  on  github  

WAAT  -­‐  Java  

Page 24: The what, why and how of web analytics testing

•  Ruby  gem  implemented  over  WAAT-­‐Java  

•  Uses  RJB  –  Ruby-­‐Java-­‐Bridge  •  Supports  2  plugins  •  HUpSniffer  •  JsSniffer  

•  Available  on  github  and  rubygems.org  

WAAT  -­‐  Ruby  

Page 25: The what, why and how of web analytics testing

Omniture  Debugger  

Page 26: The what, why and how of web analytics testing

Omniture  Debugger  How  does  it  work?    Pros  •  OS  independent  •  Run  using  the  regular  test-­‐user    Cons  •  Browser  dependent  –  need  to  implement  

ScriptRunner  for  the  UI-­‐driver  in  use  •  Web-­‐AnalyFc  soluFon  dependent  –  Adobe  MarkeFng  

Cloud  /  Omniture  SiteCatalyst    

Page 27: The what, why and how of web analytics testing

HHpSniffer  How  does  it  work?    Pros  •  Web-­‐analyFc  soluFon  independent  •  Browser  independent  •  UI-­‐driver  independent    Cons  •  3rd  party  libraries  are  OS  Dependent  •  HTTPs  not  supported  out-­‐of-­‐the-­‐box  •  Run  tests  as  ‘root’    

Page 28: The what, why and how of web analytics testing

JsSniffer  How  does  it  work?    Pros  •  Web-­‐analyFc  soluFon  independent  •  Browser  independent  •  HTTPs  supported  out-­‐of-­‐the-­‐box  •  No  dependency  on  any  3rd  party  library      Cons  •  Need  to  write  javascript  to  get  the  URL  from  the  

browser  •  UI-­‐driver  dependent  

Page 29: The what, why and how of web analytics testing

•  Download  zip  from  github  /  rubygems.org  

•  Setup  

•  jpcap  /  ScriptRunner  setup    

•  Update  exis*ng  tests  

How  to  use  WAAT?  

Page 30: The what, why and how of web analytics testing

Update  exis3ng  Tests  •  Import  relevant  packages  /  gems  

•  Define  &  provide  parameter  values  

•  Ini*alize  Engine  

•  Enable  Web  Analy*cs  Tes*ng  

•  Define  Test  Data  

•  Verify  Web  Analy*cs  repor*ng  using  WAAT  

•  Valida*ons  

•  Disable  Web  Analy*cs  Tes*ng  

Page 31: The what, why and how of web analytics testing

<Section !!!actionName="OpenUpcomingPage_HttpSniffer"!!numberOfEventsTriggered="1"!

!tagList="pageName=upcoming:index||!! ! !cc=USD||!! ! !ch=upcoming||!! ! !events=event2||"/>!

Define  Test  Data  

Page 32: The what, why and how of web analytics testing

Ini3alize  Engine  

!engine = getInstance(!! ! !webAnalyticTool, !! ! !inputFileType, !! ! !keepLoadedFileInMemory, !!! ! !log4jPropertiesAbsoluteFilePath!! ! !);!

Page 33: The what, why and how of web analytics testing

Enable  Web  Analy3cs  Tes3ng  

engine.enableWebAnalyticsTesting();!

Page 34: The what, why and how of web analytics testing

Verify  Web  Analy3cs  Repor3ng  

!Result verificationResult = !!! !engine.verifyWebAnalyticsData (!! ! !inputDataFileName, !! ! !actionName, !! ! !urlPatterns, !! ! !minimumNumberOfPackets);!

Cart.checkout();!

Page 35: The what, why and how of web analytics testing

Sample  Valida3ons  assertNotNull(verificationResult.getVerificationStatus(), "Verification status should NOT be NULL"); !!assertNotNull(verificationResult.getListOfErrors(), "Failure details should NOT be NULL"); logVerificationErrors(verificationResult); !!assertEquals(verificationResult.getVerificationStatus(), Status.PASS, "Verification status should be PASS"); !!assertEquals(verificationResult.getListOfErrors().size(), 0, "Failure details should be empty");!

Page 36: The what, why and how of web analytics testing

Disable  Web  Analy3cs  Tes3ng  

engine.disableWebAnalyticsTesting();!

Page 37: The what, why and how of web analytics testing

hUp://essenceo#esFng.blogspot.com/search/label/waat  

hUps://github.com/anandbagmar/  

hUp://rubygems.org/gems/WAAT  

[email protected]                        [email protected]  

 

   @BagmarAnand