SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Ajax Load Testing Considerations Load Testing Ajax Websites
Background	 Eric Beland  Co-Founder, Testomatix http://testomatix.com ebeland@testomatix.com Twitter: @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 Layer Advantage: Scalable - No browser Small memory and CPU footprint   Tools:  HP LoadRunner, Jmeter, Grinder, Oracle e-Load Created by:  Recording from within the browser—browser plugins or hooks. Intercepting requests with a proxy tool.  May be hand-scripted.
Challenges At the HTTP layer Things that aren’t as smooth when simulating the browser…
Hard-Coded URLs
Hard-coded URLs If 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
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 easily Highly JavaScript-dependent code. Any client-server interaction that is dependent on complex client-side computation Unless you re-implement the logic in your testing tool… Client-side decompression Client side JS encryption (Don’t do this. Really.) Obfuscation Streaming
Recording Issues – Ajax+ REST Issues REST (Representational State Transfer) makes use of 4 HTTP verbs  GET, POST, PUT and DELETE Browsers 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 Maintenance Script 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 Consideration Ajax 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 Cache Timestampsmay be hard coded in your recorded posts We have seen JavaScript caching, with timestamps which need to be updated.
Validate Ajax Returns For 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 Fields Think 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.
Ajax Autocomplete Autocomplete made these requests: ,[object Object]
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=1 http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3 http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
AJAX Polling or AJAX Streaming JavaScript 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.
Reporting Many 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 Times AJAX response time expectations Not the same as page load response expectations Ajax 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 painful UI Responsiveness rules are pretty brutal when applied to web applications.
Timeouts Choosing timeouts Load/Scalability tests Lower 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 Testing Browser-based load testing. Historically, not very scalable. Enter the cloud The cloud makes browser based load testing scalable.  LoadStorm
Benefits Script maintainability Changes to the websites AJAX code will flow through as JavaScript is executed at test-time. Proper handling of:  Changes  to Polling intervals New AJAX requests Deleted AJAX requests Auto-complete fields

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (10)

Jerry Kain's Featured Projects
Jerry Kain's Featured ProjectsJerry Kain's Featured Projects
Jerry Kain's Featured Projects
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
William\'s Feature SteelMaster Projects
William\'s Feature SteelMaster ProjectsWilliam\'s Feature SteelMaster Projects
William\'s Feature SteelMaster Projects
 
Greg Broderick's Featured Projects
Greg Broderick's Featured ProjectsGreg Broderick's Featured Projects
Greg Broderick's Featured Projects
 
Hiulary Duff
Hiulary DuffHiulary Duff
Hiulary Duff
 
Jon\'s Feature SteelMaster Projects
Jon\'s Feature SteelMaster ProjectsJon\'s Feature SteelMaster Projects
Jon\'s Feature SteelMaster Projects
 
SteelMaster International Projects
SteelMaster International ProjectsSteelMaster International Projects
SteelMaster International Projects
 
Auto transactional data analysis
Auto transactional data analysis Auto transactional data analysis
Auto transactional data analysis
 
How people search
How people searchHow people search
How people search
 
Grant Abc
Grant AbcGrant Abc
Grant Abc
 

Kürzlich hochgeladen

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 

Kürzlich hochgeladen (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 

Ajax Load Testing Considerations

  • 1. Ajax Load Testing Considerations Load Testing Ajax Websites
  • 2. Background Eric Beland Co-Founder, Testomatix http://testomatix.com ebeland@testomatix.com Twitter: @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 Layer Advantage: Scalable - No browser Small memory and CPU footprint Tools: HP LoadRunner, Jmeter, Grinder, Oracle e-Load Created 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 layer Things that aren’t as smooth when simulating the browser…
  • 9. Hard-coded URLs If 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
  • 10.
  • 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 easily Highly JavaScript-dependent code. Any client-server interaction that is dependent on complex client-side computation Unless you re-implement the logic in your testing tool… Client-side decompression Client side JS encryption (Don’t do this. Really.) Obfuscation Streaming
  • 13. Recording Issues – Ajax+ REST Issues REST (Representational State Transfer) makes use of 4 HTTP verbs GET, POST, PUT and DELETE Browsers 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 Maintenance Script 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 Consideration Ajax 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 Cache Timestampsmay be hard coded in your recorded posts We have seen JavaScript caching, with timestamps which need to be updated.
  • 17. Validate Ajax Returns For 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 Fields Think 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.
  • 19.
  • 20.
  • 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=1 http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3 http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
  • 23. AJAX Polling or AJAX Streaming JavaScript 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. Reporting Many 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 Times AJAX response time expectations Not the same as page load response expectations Ajax 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 painful UI Responsiveness rules are pretty brutal when applied to web applications.
  • 26. Timeouts Choosing timeouts Load/Scalability tests Lower 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 Testing Browser-based load testing. Historically, not very scalable. Enter the cloud The cloud makes browser based load testing scalable. LoadStorm
  • 29. Benefits Script maintainability Changes to the websites AJAX code will flow through as JavaScript is executed at test-time. Proper handling of: Changes to Polling intervals New AJAX requests Deleted AJAX requests Auto-complete fields
  • 30. When to use browser-based testing When you have an Ajax heavy or dynamic site When you have flash or difficult-to-reproduce interactions. When your man-hours are precious Easier maintenance and development make it worthwhile Generally affordable for small tests, run frequently When you can!
  • 31. When not to used browser-based testing When you need to test 200,000 users. Cost prohibitive When 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.