Learn how to monitor end-to-end workflows from every corner of the world. Hear the basics of AppDynamics Synthetic Monitoring and its integration in the AppDynamics Unified Monitoring Platform. Dive into scripting and how it allows monitoring of complex end-to-end workflows via a set of real-world examples describing best practices and tips to write better scripts and avoid common pitfalls.
Key takeaways:
o What AppDynamics Synthetic Monitoring can do today, and where the technology is going
o See how Synthetic Monitoring complements Real User Monitoring and APM
o Overview of the best tools available to help you build scripts quickly and reliably
o Tips for handling complex websites, avoiding common pitfalls, and leveraging synthetic monitoring to run WebDriver scripts
For more information, go to: www.appdynamics.com
6. Synthetic monitoring
AppDynamics Confidential and Proprietary 6
http://my-ecommerce.com
or
Script describing a user transaction
Pro-active monitoring of Websites from 25+ locations in the world
9. WebDriver (aka Selenium)
• W3C standard, open source
• Supported language: python
• Features:
– All typical user interactions
– DOM inspection
– JavaScript execution
– Anything that can be done
in python
AppDynamics Confidential and Proprietary 9
16. End User Monitoring
AppDynamics Confidential and Proprietary 16
User Experience at a glance – drill down for sessions, errors, metrics…
17. Synthetic is orthogonal to APM & EUM
• Proactive monitoring
• Controlled environment
• Provides visibility from outside the application
17AppDynamics Confidential and Proprietary
18. Controlled environment
• Choose relevant locations & browsers
• Emulate slower networks with traffic shaping
– Cable, DSL, Mobile, …
• Use assertions to validate correct behavior
• Re-run tests automatically to confirm errors
AppDynamics Confidential and Proprietary 18
19. Example: eCommerce application
• Key objectives
– users can always complete checkout
– items are sold at the correct price
– site is fast enough so as to not discourage users
• Implementation
– Single script going through the desired workflow
– Assertion to validate cart total
AppDynamics Confidential and Proprietary 19
26. Visually Complete Time
• Typical UX metric, onload time, is not completely relevant
– Includes irrelevant things (bellow the fold)
– Misses other relevant items
• Example: timer after onload to display prices and buy button
• Visually Complete gives the time at which the page is “ready”
APPDYNAMICS CONFIDENTIAL AND PROPRIETARY 26
27. Synthetic + APM with BT correlation
AppDynamics Confidential and Proprietary 27
Pro-active monitoring with deep visibility through the application stack
29. How to write a good script?
• Option 1: use a recorder from the Selenium community
• Option 2: write from scratch
AppDynamics Confidential and Proprietary 29
30. My typical scripting workflow
1. Define high level goals for the script
2. Come up with selectors to interact with the site
3. Write & Debug on my laptop with Selenium
4. Upload to Synthetic
5. Run & Debug
APPDYNAMICS CONFIDENTIAL AND PROPRIETARY 30
31. Key ingredient: understand how your app is built
AppDynamics Confidential and Proprietary 31
• The DOM describes your app
• It is the basic data structure used to
interact with your page in WebDriver
• The DOM on your website can be
built
– Statically, simple HTML rendering
– Dynamically, using JavaScript &
AJAX
(image by Birger Eriksson / CC BY-SA 3.0)
32. Identifying elements of the website
• WebDriver uses selectors to locate elements (Xpath or CSS)
• Problems:
– When multiple paths are available, which one to pick?
– What if a path resolves to multiple elements?
– What it the DOM changes?
– When should IDs be used?
AppDynamics Confidential and Proprietary 32
33. WebDriver Scripting Assistant
• Chrome extension
– easily find reliable CSS selectors
• Uses IDs or unique attributes
– except if they are automatically
generated
• Picks the shortest available
selectors
• Avoids overly generic selectors
AppDynamics Confidential and Proprietary 33
34. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 34
Click on Button 1
WebDriver Script
Click on Button 2
Web Browser
Browser handles event.
UI is updated
Button 2 appears
2nd click requested after browser
is done completing the 1st click
time time
35. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 35
Click on Button 1
WebDriver Script
Click on Button 2
Web Browser
time time
2nd click requested too early
Script will crash
Browser handles event.
Higher network latency
(remote location?)
UI is updated
Button 2 appears
36. AppDynamics Confidential and Proprietary 36
• Script is crashing
• No alerts go out
• Website in trouble
• Alerts are sent
37. AppDynamics Confidential and Proprietary 37
• Script is crashing
• No alerts go out
• Website in trouble
• Alerts are sent
Tip: use automatic re-test to weed out false positives
(which may be due to temporary latency glitches)
38. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 38
Click on Button 1
WebDriver Script
Click on Button 2
Web Browser
time time
2nd click requested too early
Script will crash
Browser handles event.
Higher network latency
(remote location?)
UI is updated
Button 2 appears
39. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 39
Click on Button 1
WebDriver Script
Click on Button 2
Web Browser
time time
Browser handles event.
Higher network latency
(remote location?)
UI is updated
Button 2 appears
Solution 1: configure implicit waits
WebDriver will retry automatically
40. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 40
Click on Button 1
WebDriver Script
Wait for Button 1
to become clickable
Web Browser
time time
Browser handles event.
Higher network latency
(remote location?)
UI is updated
Button 2 appears
Solution 2: set an explicit wait on
Button2
Click on Button 2
41. Challenge #1: sequence of actions
AppDynamics Confidential and Proprietary 41
Click on Button 1
WebDriver Script
Click on Button 2
Web Browser
time time
2nd click requested too early
Script will crash
Browser handles event.
Higher network latency
(remote location?)
UI is updated
Button 2 appears
Tip: request a screenshot
42. Developers, developers, developers!
• Website implementations are sometimes “curious”
• Best practice:
– Design websites with “testability” in mind
• Enlist developers
• Use scripts both for functional testing & monitoring in Synthetic
AppDynamics Confidential and Proprietary 42