Clicky

Load Testing Technologies

AJAX Load Testing

More than 20 years ago there was no way to update a web page without displaying a boring white screen while reloading of the whole page. Thankfully, AJAX has closed this gap and introduced asynchronous data load concept, which enables user to interact with the page while data loads in the background. Nowadays, this concept is the foundation of our content rich and interactive web applications.

AJAX is an abbreviation for Asynchronous JavaScript and XML and it’s more than a technology because it consists of HTML, CSS, JavaScript, XMLHttpRequest and a server side scripting language such as PHP. An AJAX request consists of the following 6 steps:

  1. A web page fires a content change event
  2. The handler of this web page creates an XMLHttpRequest object
  3. The XMLHttpRequest object requests a document from the server
  4. The Server retrieves appropriate data and sends it back
  5. The XMLHttpRequest fires an event to notify the web page the data has arrived
  6. The handler processes the data and displays it

The flipside from a performance engineer’s perspective is that automation of such asynchronous communication is tricky. Consider load testing a web application which has to serve 100 concurrent users and 10000 searches per hour. You are tasked to validate if the average response time of this application is within the boundaries of 3 seconds.

Basically, you have two options for such a load test scenario:

  1. Protocol-based simulation
  2. Browser-based simulation

Let’s compare protocol level with browser level load simulation.
The table below reflects the results of this experiment:

Description

Screenshot

Protocol Level Simulation

1 Client-Server Request

0.52 sec load time

 Protocol Level Simulation

Browser Level Simulation

32 Client-Server Requests

2.18 sec load time

 Browser Level Simulation

If you decide to use the protocol-based simulation, you would miss 10000 x 31 = 310000 requests and report incorrect response times because a huge proportion of its response times are lost on client side. Obviously, this would lead to totally inaccurate load testing results.

AngularJS Load Testing

Frontend developers love AngularJS because it helps to simplify complex code. This simple and powerful framework solves the error prone DOM manipulation issues with its declarative description of the UI flow. AngularJS is an open source JavaScript Framework and can be added to a page with a simple script tag such as:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>

It supports separation of concern and brings dynamic elements to static HTML. Like any other application, also AngularJS based systems can quickly be impacted by performance issues. Here are a few steps you can take to speed things up on your next NG load testing project:

  • Reduce the number of DOM operations to the minimum
  • Reduce the total elements of your DOM tree
  • Use Chrome profiler to check the memory footprint
  • Reduce the activities in your watcher

LoadView gives you everything you need when it comes to accurate AngularJS load testing.

The example below uses a message input filed based on AngularJS. The screenshot below contains its source code on the left side and the app on the right side.

Description

Screenshot

Record Test Script for AngularJS Application

 

Record the AngularJS script with EveryStep

 

 

 Test Script for AngularJS Application

Design Load Test for AngularJS Application

 

Configure the Test Execution Plan

 

 

 Test Execution Plan

Flash Load Testing

Flash is an authoring software and is used to create vector graphic based animations. It’s a platform independent technology and runs on any machine where Flash player is installed. Due to security concerns companies often ban Flash from their infrastructure. However, you can build nice applications with Flash, the overhead is low with the small disadvantage that it won’t run without an enabled Flash player plugin.

LoadView gives you everything you need when it comes to accurate FLASH load testing. I’ve used a simple Flash based Calculator: https://www.dotcom-tools.com/samples/Calculator.html. My load test scenario executes a simple 1 + 2 = 3 calculation.

Description

Screenshot

Record a Test Script for a Flash Application

 

Record the script with EveryStep

Add verification

Run & Upload the script

 

 

 Record a Test Script for a Flash Application

Design a Load Test for a Flash Application

 

Configure the Test Execution Plan

 

Distribute your virtual user on load injectors located around the world

 Design a Load Test for a Flash Application

Run the Load Test for the Flash Application

 

Watch how LoadView ramps up the load and take note of the response times of your Flash application during the load test.

 Run the Load Test for the Flash Application

Result Analysis for the Flash Application

 

Once the test run has finished, LoadView will provide a detailed report, videos and valuable insight such as waterfall charts or videos.

 

Share those your dev team to identify the root-cause of hotspots.

 

 

 Result Analysis for the Flash Application

Known Issue

 

 Scripting of a Flash based application works only with Internet Explorer. You will receive the following error if you use Chrome or any other Browser for your recording in EveryStep.
 

 

 Known Issue

HTML5 Load Testing

Flash is an authoring software and is used to create vector graphic based animations. It’s a platform independent technology and runs on any machine where Flash player is installed. Due to security concerns companies often ban Flash from their infrastructure. However, you can build nice applications with Flash, the overhead is low with the small disadvantage that it won’t run without an enabled Flash player plugin.

HTML5 builds on HTML, our Hypertext Markup Language which is still the backbone of our web applications. The ingredients of HTLM5 are:

  • HTML which provides the structure
  • CSS which takes care for the presentation
  • JavaScript which makes things happen

HTML5 gives you everything required to implement beautiful applications which are running in your browser without the need of any plugins. Such applications are completely cross-platform based. They run on any device if your browser supports HTML5. The following is an example of load testing HTML5 with LoadView.

Description

Screenshot

Record a Test Script for an HTML5 Application

 

Record the script with EveryStep

Add verification

Run & upload the script

 

 

 Test Script for HTML5 Application

Design a Load Test for an HTML5 Application

 

Configure the Test execution plan

 

Distribute your virtual user on load injectors located around the world

 Load Test for HTML5 Application

Run a Load Test for an HTML5 Application

 

Watch how LoadView ramps up the load and response times of your HTML5 application behaves during load test execution.

 Load Test HTML5 Applications

Result Analysis for an HTML5 Application

 

Once the test run has finished LoadView will provide a detailed report, videos and valuable insight such as waterfall charts or videos.

 

Share those your dev team to identify the root-cause of hotspots.

 

 

 Load Test Result Analysis

JavaScript Load Testing

JavaScript is the major programming language of the web. It is used to bring interactive features to the web and builds the foundation for many frameworks such as AngularJS or AJAX. Hackers have used JavaScript recently to execute critical commands on victim’s machine. You can disable JavaScript execution in your Browser but this will block many websites on your computer.

There are some known performance limitations when it comes to JavaScript. It’s a good idea to investigate those in your next JavaScript based load test. Here are some things that you can do:

  • Reduce activity in loops:
    • Don’t make calculations inside your loops because this gets executed many times and impacts response times.
  • Reduce DOM access:
    • DOM access is slow. Create a local variable, assign the required value and use this for your operations.
  • Reduce DOM size:
    • Keeping DOM size small will speed up page load times and DOM access via JavaScript.
  • Delay JavaScript loading:
    • Load the script at the end of your page because it will block page rendering until the download has finished. Alternatively, you can also use the “defer=true” tag loads the script after your page has rendered.

LoadView gives you everything you need when it comes to accurate JavaScript load testing. The example below illustrates how easy JavaScript load testing actually is with LoadView.

Description

Screenshot

Record Test Script for Your Application

 

Record the script with EveryStep

 

Run & Upload the script

 

 

 

Design Load Test for Your Application

 

Configure the Test Execution Plan

 

Distribute your virtual user on load injectors located around the world

 

Run the Load Test for Your Application

 

Watch how LoadView ramps up the load and response times of your JavaScript application behaves during load test execution.

 

Result Analysis for Your Application

 

Once the test run has finished LoadView will provide a detailed report, videos and valuable insight such as waterfall charts or videos.

 

Share those your dev team to identify the root-cause of hotspots.

 

 

 

JSON Load Testing

JSON is an abbreviation for JavaScript Object Notation and is quite similar to XML. It’s a very common data format and used for all kind of browser-server communication. Simplicity, broad programming language support and low overhead are the reason for its popularity.

Some JSON specific performance hotspots are

  • Download of large files takes too long
  • Memory utilization is too high

In comparison with SOAP XML, the footprint of JSON lower and it’s easier to read. The following example illustrates JSON load testing with LoadView.

We use JSON in the search functionality on our website. This is the corresponding JSON source code:

This is the search functionality which we will use in the JSON load testing showcase:

We’ve used Chrome developer tools to identify the request URL used in this search form.

You can easily setup a HTTP based task which executes this search request using the url https://www.dotcom-monitor.com/?s=load+test but this won’t stress the JSON search hint feature. Therefore, I’ve decided to setup a real browser based test using our EveryStep solution, record the search and use it in my load test./p>

Description

Screenshot

Record Test Script for JSON Application

 

Load testing begins with recording a script, using the EveryStep scripting tool.

 

 

Design Load Test for JSON Application

 

In this step, you can configure your testing plan and locations.

 

Run the Load Test for JSON Application

 

Watch how LoadView ramps up the load and response times of your JSON5 application behaves during load test execution.

 

Result Analysis for JSON Application

 

LoadView produces a waterfall chart and report that can be shared with developers to identify problems and implement changes.

 

 

Single Page Application Load Testing

Single Page Applications (SPA) behave more like a desktop application because they dynamically rewrite the current page instead of loading entire new pages from a server. The user experience on such SPA’s is often better since there are fewer interruptions. Initial load times of SPA’s are typically longer because frameworks must be downloaded. SOAP, JSON or AJAX are frequently used for communication between SPA client and server.

Some of the most burning performance issues of SPAs are:

  • Initial page load time is long: Reduce the size of your frameworks
  • Memory leaks: Review memory footprint of your SPA regularly
  • Data presentation: Load not more data what can be seen, lazy data loading

LoadView gives you everything you need when it comes to accurate SPA load testing. We’ve used the following application for this load testing showcase http://www.welcometofillory.com/map

Description

Screenshot

Record Test Script for Single Page Application

 

 

 

 

Design Load Test for Single Page Application

 

 

 

Run the Load Test for Single Page Application

 

Watch how LoadView ramps up the load and response times of your application behaves during load test execution.

 

Result Analysis for your Single Page Application

 

 

 

 

As mentioned before, SPAs initial page load time is often quite long. In our showcase, the download of this initial page took more than 35 seconds and the page size is more than 95 MB. Obviously, this application needs some tuning.

SOAP Load Testing

Our Simple Object Access Protocol (SOAP) is a much more than a programming language. Contrary to JavaScript which is a development language, enables SOAP communication across any device and operating system. The basic building block of SOAP is XML. SOAP has introduced a format for sending and receiving messages.

Some of the most popular performance hotspots related to SOAP are

  • Chatty application
  • Wrong or no caching strategy
  • Serialization causes high overhead
  • No input validation on consumer side or inefficient web method processing

SOAP based web services provide a description of their services in WSDL. This web service description language can be used for manual our automated testing. In our showcase below I will demonstrate how to setup load tests of a SOAP based application.

This simple CurrencyConverter will be used in our sample load test setup:

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

The following steps outline how to perform SOAP load testing with LoadView.

Description

Screenshot

Create the Test Script for your Application

 

Create an HTTP task, add the POST request details

 

 

 

Design Load Test for your Application

 

 

 

Run the Load Test for your Application

 

Watch how LoadView ramps up the load and how response times of your SOAP application behaves during load test execution.

 

Result Analysis for your Application

 

 

 

 
 

 

WebAPI REST Load Testing

REST is a widely used communication standard and stands for Representational State Transfer. It structures data in machine-readable format and makes often use of XML or JSON. Contrary to SOAP which is highly functional oriented is REST very data driven. Restful API and Restful Services are two often used terms in this discipline but they mean nothing more than REST services.

Performance testing of REST services is all about sending data to services or verifying response from it. Some most common REST performance hotspots are

  • Chatty services
  • Too much or not required data transmitted
  • No reuse of TCP connections 

Developer communities often don’t agree whether to implement web services in SOAP or REST. From a performance perspective, REST based services are designed for speed. Their protocol overhead is lower and there is no XML parsing at all required. The case study below illustrates how WebAPI REST testing can be done with LoadView.

Description

Screenshot

Create the Test Script for your Restful Service

 

Create an HTTP task

 

Add the GET request details

 

Add the keyword validation

 

 

Design Load Test for your Application

 

Set up the test and execution plan

 

Run the Load Test for your Application

 

Watch the load curve as the test initiates

 

Result Analysis for your Application

 

Analyze the results and share with the dev team

 

 

 

 

WebSockets Load Testing

Web Sockets are designed to enable two-way communication between client and server which mean both parties communicate and exchange data at the same time. True concurrency and performance optimization are the two key points of Web Sockets.

The major advantages of Web Sockets are:

  • Bidirectional: No predefined message pattern, Client or server can send a message to the other party
  • Full Duplex: independent communication between Client and Server
  • Single TCP Connection: Upgrade HTTP connection, Client and Server communicate over the same TCP connection

If we compare Web Sockets with REST or SOAP based communications patterns, response times of the former are much better because Web Sockets enables reuse of the same TCP connection. Research has shown that Web Socket based services are up to 10 times faster.

For this test, we’ll use a ChatBot which answers some basic questions.

Description

Screenshot

Record Test Script for your Web Socket based Application

 

 

 

 

 

Design Load Test for your Web Socket based Application

 

Create the testing plan and distribute the load among various testing locations.

 

Run the Load Test for Web Socket based Application

 

 

Result Analysis for Web Socket based Application