SlideShare a Scribd company logo
Ajax Load Testing ConsiderationsLoad Testing Ajax Websites
Background	Eric Beland Co-Founder, Testomatixhttp://testomatix.comebeland@testomatix.comTwitter: @testomatix	Testomatix provides full service performance testing including expert planning, scripting, and test execution. We test for you, and help you tune.
Testing Ajax Websites
Will it Scale?What happens when people show up?
Testing at the HTTP Layer
Testing at the HTTP LayerAdvantage: Scalable - No browserSmall memory and CPU footprint  Tools:  HP LoadRunner, Jmeter, Grinder, Oracle e-LoadCreated by: Recording from within the browser—browser plugins or hooks.Intercepting requests with a proxy tool. May be hand-scripted.
Challenges At the HTTP layerThings that aren’t as smooth when simulating the browser…
Hard-Coded URLs
Hard-coded URLsIf a request is dependent on a previous Ajax request which, after a certain number of users starts failing, a real user would fail.  If you have a hard-coded the URL, your test will pass when it shouldn’t.If an Ajax request is vital to the user interaction,Content-checked (match against text in the HTML)Or defined as a RegExp source for navigation
Eric Beland Ajax Load Testing Considerations
Recording Issues – Is it recording?Does your tool record AJAX traffic?VS 2005 doesn't record Ajax calls.Proxy-based tools tend to do well when recording Ajax.Some proxy based recorders can’t record https traffic. Jmeter, for example
Things that won’t work, at least easilyHighly JavaScript-dependent code.Any client-server interaction that is dependent on complex client-side computationUnless you re-implement the logic in your testing tool…Client-side decompressionClient side JS encryption (Don’t do this. Really.)ObfuscationStreaming
Recording Issues – Ajax+ REST IssuesREST (Representational State Transfer) makes use of 4 HTTP verbs GET, POST, PUT and DELETEBrowsers do not have support for PUT and DELETE currently (HTML 5) But it IS supported in the XMLHttpRequest implementation in all major browsers.But, your load testing tool may not be able to record it, or replay it.Currently (Sept. 09) the case in Oracle e-Load.  Used to be an issue in JMeter.Likely still an issue in other tools.
Script MaintenanceScript recording	Unless you remember, or your testers determine every place Ajax has been added or removed from a script, you need to recreate your scripts for them to be accurate.A “real life” example:http://thedailywtf.com/Articles/Slowing-Time.aspx
Statefulness ConsiderationAjax requests may require a session cookie, or value in a cookie.If the cookie is not configured to be updated, the request will fail.
Client-side JS Timestamp on CacheTimestampsmay be hard coded in your recorded postsWe have seen JavaScript caching, with timestamps which need to be updated.
Validate Ajax ReturnsFor valid testing, the return values of AJAX calls must be validated.If they are not validated, the script may appear to work past the number of users which the application can support.
AutoComplete FieldsThink time between Ajax requests—users type quickly.In order to replicate real load, and exercise any caching effectively, requests must be parameterized.AutoComplete fields send requests key-by-key. Parameterization may not account for this properly.
Eric Beland Ajax Load Testing Considerations
Ajax AutocompleteAutocomplete made these requests:Parameterization is tricky.
The correct way to generate the load is to make multiple requests for the parameter.
Additionally, it looks like cp=could be a character count. http://clients1.google.com/complete/search?hl=en&client=hp&q=a&cp=1http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
AJAX Polling or AJAX StreamingJavaScript which does AJAX polling in the background. Polling interval may change, which changes the load associated with a page.Comet (Streaming)When added or removed, load scripts must be updated.
ReportingMany tools work on the “page” model for load testing.  Ajax apps do not necessarily follow the page model, and in many cases, the application is not “working” when the AJAX functionality is not working.Ajax timeouts must be treated as full-fledged failures.
AJAX Response TimesAJAX response time expectationsNot the same as page load response expectationsAjax response times should follow UI response time rules, which have their own laws, and generally need to be faster.A 6 second page load might be ok, but a 6 second lag between UI responses is painfulUI Responsiveness rules are pretty brutal when applied to web applications.
TimeoutsChoosing timeoutsLoad/Scalability testsLower timeouts are appropriate for Ajax heavy applications.Determine how many users you can support within acceptable-response times.10 seconds is probably a reasonable threshold for an Ajax request.
AJAX/UI response time rules Excerpt from Jacob Nielsen's Usability Engineering"The basic advice regarding response times has been about the same for almost thirty years [Miller 1968; Card et al. 1991]: 0.1 second is about the limit for having the user feel that the system is reacting instantaneously, meaning that no special feedback is necessary except to display the result. 1.0 second is about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay. Normally, no special feedback is necessary during delays of more than 0.1 but less than 1.0 second, but the user does lose the feeling of operating directly on the data. 10 seconds is about the limit for keeping the user's attention focused on the dialogue. For longer delays, users will want to perform other tasks while waiting for the computer to finish, so they should be given feedback indicating when the computer expects to be done. Feedback during the delay is especially important if the response time is likely to be highly variable, since users will then not know what to expect."
New Alternatives to HTTP Layer TestingBrowser-based load testing.Historically, not very scalable.Enter the cloudThe cloud makes browser based load testing scalable. LoadStorm
BenefitsScript maintainabilityChanges to the websites AJAX code will flow through as JavaScript is executed at test-time.Proper handling of: Changes to Polling intervalsNew AJAX requestsDeleted AJAX requestsAuto-complete fields

More Related Content

PPTX
Ajax Load Testing Concerns By Eric Beland
PPT
Neoload overview
PPTX
Load Testing using Continuous Integration tools
PDF
Neoload
PPTX
Dave Orchard - Offline Web Apps with HTML5
PPT
Dyna trace
PPTX
Using Automation to Meet Demands for Performance and Quality
PPTX
Mountebank and you
Ajax Load Testing Concerns By Eric Beland
Neoload overview
Load Testing using Continuous Integration tools
Neoload
Dave Orchard - Offline Web Apps with HTML5
Dyna trace
Using Automation to Meet Demands for Performance and Quality
Mountebank and you

What's hot (20)

PPT
Ajax Testing Approach
PPT
Ajax Testing Approach
PPT
Web performance testing
PPT
ASP.NET AJAX with Visual Studio 2008
PPT
Ajax & ASP.NET 2
PDF
Performance testing automation with Dynatrace @LDNWebPerf - AndreasGrabner
DOCX
Load testing with vs 2013
PDF
Effectively Monitoring Client-Side Performance
PPTX
10 practices that every developer needs to start right now
PPTX
Slideshare - Magento Imagine - Do You Queue
PPTX
Lightning page optimization & best practices
PDF
Client-side Web Performance Optimization [paper]
PPTX
Load testing with Visual Studio and Azure - Andrew Siemer
PPTX
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
PPTX
Systematic Load Testing of Web Applications
PDF
Visual studio performance testing quick reference guide 3 6
PPTX
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
PPTX
How to make a Load Testing with Visual Studio 2012
PPTX
Sydney Continuous Delivery Meetup May 2014
PPTX
Client side performance analysis
Ajax Testing Approach
Ajax Testing Approach
Web performance testing
ASP.NET AJAX with Visual Studio 2008
Ajax & ASP.NET 2
Performance testing automation with Dynatrace @LDNWebPerf - AndreasGrabner
Load testing with vs 2013
Effectively Monitoring Client-Side Performance
10 practices that every developer needs to start right now
Slideshare - Magento Imagine - Do You Queue
Lightning page optimization & best practices
Client-side Web Performance Optimization [paper]
Load testing with Visual Studio and Azure - Andrew Siemer
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
Systematic Load Testing of Web Applications
Visual studio performance testing quick reference guide 3 6
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
How to make a Load Testing with Visual Studio 2012
Sydney Continuous Delivery Meetup May 2014
Client side performance analysis
Ad

Viewers also liked (20)

PDF
High Performance Green Building: What is it worth?
PPTX
Saving money with MFDs
PPT
Teorikaunseling 090910112241-phpapp01
PPT
Future Simple 3 eso
PPT
Soil Andie
PDF
Kurikulum 2013 SMA
PPT
Soil Powerpt Andie
PPTX
David Wei And Changhao Jiang Presentation
PPT
Comparative and Superlative - as-as 4 ESO
PPT
Variability
PPT
ProjectRFIDjustbib
PDF
11 оригинальных способов использования Wrike
PDF
2011 Q2 Green Viewpoint
PPTX
Pengembangan Kurikulum
PDF
Informativo Técnico Leite 2010
PDF
Accounting For GHG Emissions In The Commercial Building Sector Final
PPT
1st Conditional
PPTX
innoveren_met_big_data_jr_helmus
PPTX
Cardiovascular system or the circulatory system
DOC
Perjalanan Yang B Elum Selesai (3)
High Performance Green Building: What is it worth?
Saving money with MFDs
Teorikaunseling 090910112241-phpapp01
Future Simple 3 eso
Soil Andie
Kurikulum 2013 SMA
Soil Powerpt Andie
David Wei And Changhao Jiang Presentation
Comparative and Superlative - as-as 4 ESO
Variability
ProjectRFIDjustbib
11 оригинальных способов использования Wrike
2011 Q2 Green Viewpoint
Pengembangan Kurikulum
Informativo Técnico Leite 2010
Accounting For GHG Emissions In The Commercial Building Sector Final
1st Conditional
innoveren_met_big_data_jr_helmus
Cardiovascular system or the circulatory system
Perjalanan Yang B Elum Selesai (3)
Ad

Similar to Eric Beland Ajax Load Testing Considerations (20)

PPT
Using Ajax In Domino Web Applications
PDF
C sharp and asp.net interview questions
PPT
PDF
PAC 2019 virtual Arjan Van Den Berg
PPTX
Oracle appsloadtestbestpractices
PPT
Ajax: User Experience
PPT
W-JAX Performance Workshop - Web and AJAX
PPT
Ajax
PPT
Ajax and PHP
PPT
Developing Java Web Applications In Google App Engine
PDF
Presemtation Tier Optimizations
PDF
Ajax
PPT
Plop
PPT
High Performance Websites By Souders Steve
PPT
High Performance Web Sites
TXT
25250716 seminar-on-ajax text
PPT
Web site optimization
PPT
Web Site Optimization
Using Ajax In Domino Web Applications
C sharp and asp.net interview questions
PAC 2019 virtual Arjan Van Den Berg
Oracle appsloadtestbestpractices
Ajax: User Experience
W-JAX Performance Workshop - Web and AJAX
Ajax
Ajax and PHP
Developing Java Web Applications In Google App Engine
Presemtation Tier Optimizations
Ajax
Plop
High Performance Websites By Souders Steve
High Performance Web Sites
25250716 seminar-on-ajax text
Web site optimization
Web Site Optimization

More from Ajax Experience 2009 (20)

PPT
Adam Peller Interoperable Ajax Tools And Mashups
PPTX
Chanhao Jiang And David Wei Presentation Quickling Pagecache
PPT
Jason.O Keefe.Genuitec.Presentation.Final
PPTX
Jenny Donnelly
PDF
Colin Clark Accessible U Is With J Query And Infusion[1]
PPTX
Scott Isaacs Presentationajaxexperience (Final)
PPT
Sergey Ilinsky Presentation Ample Sdk
PPT
Chris Williams Presentation Dissident
PPT
Andrew Sutherland Presentation
PDF
Bill Scott Presentation
PDF
Ted Husted Presentation Testing Ajax Applications Ae2009
PDF
Ted Husted Api Doc Smackdown Ae2009
PDF
Patrick Lightbody Presentation Tae Slides
PPT
Laurens Van Den Oever Xopus Presentation
PPT
Jon Trelfa Presentation From Desktop To Web – Getting It Right
PPTX
Joe Mc Cann Tae Aria Presentation
PPT
Douglas Crockford Presentation Goodparts
PPT
Douglas Crockford Presentation Jsonsaga
PDF
Brian Le Roux Presentation Introducing Phone Gap
PDF
Ted Husted Presentation Testing The Testers Ae2009
Adam Peller Interoperable Ajax Tools And Mashups
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Jason.O Keefe.Genuitec.Presentation.Final
Jenny Donnelly
Colin Clark Accessible U Is With J Query And Infusion[1]
Scott Isaacs Presentationajaxexperience (Final)
Sergey Ilinsky Presentation Ample Sdk
Chris Williams Presentation Dissident
Andrew Sutherland Presentation
Bill Scott Presentation
Ted Husted Presentation Testing Ajax Applications Ae2009
Ted Husted Api Doc Smackdown Ae2009
Patrick Lightbody Presentation Tae Slides
Laurens Van Den Oever Xopus Presentation
Jon Trelfa Presentation From Desktop To Web – Getting It Right
Joe Mc Cann Tae Aria Presentation
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation Jsonsaga
Brian Le Roux Presentation Introducing Phone Gap
Ted Husted Presentation Testing The Testers Ae2009

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx

Eric Beland Ajax Load Testing Considerations

  • 1. Ajax Load Testing ConsiderationsLoad Testing Ajax Websites
  • 2. Background Eric Beland Co-Founder, Testomatixhttp://testomatix.comebeland@testomatix.comTwitter: @testomatix Testomatix provides full service performance testing including expert planning, scripting, and test execution. We test for you, and help you tune.
  • 4. Will it Scale?What happens when people show up?
  • 5. Testing at the HTTP Layer
  • 6. Testing at the HTTP LayerAdvantage: Scalable - No browserSmall memory and CPU footprint Tools: HP LoadRunner, Jmeter, Grinder, Oracle e-LoadCreated by: Recording from within the browser—browser plugins or hooks.Intercepting requests with a proxy tool. May be hand-scripted.
  • 7. Challenges At the HTTP layerThings that aren’t as smooth when simulating the browser…
  • 9. Hard-coded URLsIf a request is dependent on a previous Ajax request which, after a certain number of users starts failing, a real user would fail. If you have a hard-coded the URL, your test will pass when it shouldn’t.If an Ajax request is vital to the user interaction,Content-checked (match against text in the HTML)Or defined as a RegExp source for navigation
  • 11. Recording Issues – Is it recording?Does your tool record AJAX traffic?VS 2005 doesn't record Ajax calls.Proxy-based tools tend to do well when recording Ajax.Some proxy based recorders can’t record https traffic. Jmeter, for example
  • 12. Things that won’t work, at least easilyHighly JavaScript-dependent code.Any client-server interaction that is dependent on complex client-side computationUnless you re-implement the logic in your testing tool…Client-side decompressionClient side JS encryption (Don’t do this. Really.)ObfuscationStreaming
  • 13. Recording Issues – Ajax+ REST IssuesREST (Representational State Transfer) makes use of 4 HTTP verbs GET, POST, PUT and DELETEBrowsers do not have support for PUT and DELETE currently (HTML 5) But it IS supported in the XMLHttpRequest implementation in all major browsers.But, your load testing tool may not be able to record it, or replay it.Currently (Sept. 09) the case in Oracle e-Load. Used to be an issue in JMeter.Likely still an issue in other tools.
  • 14. Script MaintenanceScript recording Unless you remember, or your testers determine every place Ajax has been added or removed from a script, you need to recreate your scripts for them to be accurate.A “real life” example:http://thedailywtf.com/Articles/Slowing-Time.aspx
  • 15. Statefulness ConsiderationAjax requests may require a session cookie, or value in a cookie.If the cookie is not configured to be updated, the request will fail.
  • 16. Client-side JS Timestamp on CacheTimestampsmay be hard coded in your recorded postsWe have seen JavaScript caching, with timestamps which need to be updated.
  • 17. Validate Ajax ReturnsFor valid testing, the return values of AJAX calls must be validated.If they are not validated, the script may appear to work past the number of users which the application can support.
  • 18. AutoComplete FieldsThink time between Ajax requests—users type quickly.In order to replicate real load, and exercise any caching effectively, requests must be parameterized.AutoComplete fields send requests key-by-key. Parameterization may not account for this properly.
  • 20. Ajax AutocompleteAutocomplete made these requests:Parameterization is tricky.
  • 21. The correct way to generate the load is to make multiple requests for the parameter.
  • 22. Additionally, it looks like cp=could be a character count. http://clients1.google.com/complete/search?hl=en&client=hp&q=a&cp=1http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
  • 23. AJAX Polling or AJAX StreamingJavaScript which does AJAX polling in the background. Polling interval may change, which changes the load associated with a page.Comet (Streaming)When added or removed, load scripts must be updated.
  • 24. ReportingMany tools work on the “page” model for load testing. Ajax apps do not necessarily follow the page model, and in many cases, the application is not “working” when the AJAX functionality is not working.Ajax timeouts must be treated as full-fledged failures.
  • 25. AJAX Response TimesAJAX response time expectationsNot the same as page load response expectationsAjax response times should follow UI response time rules, which have their own laws, and generally need to be faster.A 6 second page load might be ok, but a 6 second lag between UI responses is painfulUI Responsiveness rules are pretty brutal when applied to web applications.
  • 26. TimeoutsChoosing timeoutsLoad/Scalability testsLower timeouts are appropriate for Ajax heavy applications.Determine how many users you can support within acceptable-response times.10 seconds is probably a reasonable threshold for an Ajax request.
  • 27. AJAX/UI response time rules Excerpt from Jacob Nielsen's Usability Engineering"The basic advice regarding response times has been about the same for almost thirty years [Miller 1968; Card et al. 1991]: 0.1 second is about the limit for having the user feel that the system is reacting instantaneously, meaning that no special feedback is necessary except to display the result. 1.0 second is about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay. Normally, no special feedback is necessary during delays of more than 0.1 but less than 1.0 second, but the user does lose the feeling of operating directly on the data. 10 seconds is about the limit for keeping the user's attention focused on the dialogue. For longer delays, users will want to perform other tasks while waiting for the computer to finish, so they should be given feedback indicating when the computer expects to be done. Feedback during the delay is especially important if the response time is likely to be highly variable, since users will then not know what to expect."
  • 28. New Alternatives to HTTP Layer TestingBrowser-based load testing.Historically, not very scalable.Enter the cloudThe cloud makes browser based load testing scalable. LoadStorm
  • 29. BenefitsScript maintainabilityChanges to the websites AJAX code will flow through as JavaScript is executed at test-time.Proper handling of: Changes to Polling intervalsNew AJAX requestsDeleted AJAX requestsAuto-complete fields
  • 30. When to use browser-based testingWhen you have an Ajax heavy or dynamic siteWhen you have flash or difficult-to-reproduce interactions.When your man-hours are preciousEasier maintenance and development make it worthwhileGenerally affordable for small tests, run frequentlyWhen you can!
  • 31. When not to used browser-based testingWhen you need to test 200,000 users.Cost prohibitiveWhen you cannot expose your site to external traffic (intranet)There are commercial load testing tools that let you run real browsers locally. For smaller tests, this can work.

Editor's Notes

  • #10: Need photo
  • #12: Mention firebug…
  • #13: Via Ajax
  • #19: Should say “send request” instead of type
  • #21: Requests in two places
  • #22: Heartbeat slide should be next to this
  • #28: Remove extra bullet