Load Testing Best Practices Using Web Load
Load Testing Best Practices Using Web Load
Best Practices
Using WebLOAD
Table of Contents
Introduction....................................................................................................... 4
WebLOAD Components and Architecture...................................................... 5
WebLOAD IDE.............................................................................................. 6
WebLOAD Console...................................................................................... 6
Load Generator (LG)................................................................................... 7
Probing Client.............................................................................................. 7
WebLOAD Analytics.................................................................................... 7
WebLOAD Dashboard................................................................................ 7
PostgreSQL DB............................................................................................ 7
TestTalk........................................................................................................ 7
WebLOAD Deployment..................................................................................... 8
Planning Your Tests........................................................................................... 10
Building Agenda Using WebLOAD IDE............................................................ 12
Record.......................................................................................................... 13
Script Manipulation..................................................................................... 14
Agenda Tree Pane and JavaScript View............................................... 14
Toolbox Pane.......................................................................................... 14
Advanced Scripting - JavaScript, DOM, XML, and Java....................... 15
Correlation................................................................................................... 16
Parameterization......................................................................................... 18
Response Validation................................................................................... 19
Testing Your Script...................................................................................... 20
Table of Contents
Executing an Agenda Using the WebLOAD Console..................................... 21
Template...................................................................................................... 22
Basic Template Definition.......................................................................... 22
Mix................................................................................................................ 23
Template and Agenda Settings................................................................. 24
Schedule Your Virtual Users and Agendas............................................... 25
Probing Client and Real User Experience................................................. 26
Cloud Load Generators.............................................................................. 27
Performance Measurements Manager.................................................... 28
APM Tools Integration................................................................................ 29
Test Automation and Continuous Integratio........................................... 29
Load Test Results Analysis................................................................................ 30
Terminology and Meanings....................................................................... 30
Timers - Response Time, Hit Time, Transactions Time........................... 31
Throughput.................................................................................................. 32
Errors of Many Kinds.................................................................................. 33
Server Measurements................................................................................ 33
Analyze Your Test Results with WebLOAD Analytics..................................... 34
Building Templates and Portfolios............................................................ 35
Publish Charts and Reports....................................................................... 35
WebLOAD Dashboard....................................................................................... 36
Creating and Editing Dashboards............................................................. 37
Viewing Currently Running and Past Session.......................................... 38
Share Dashboards...................................................................................... 38
Playlist (Slideshow)...................................................................................... 38
Introduction
This guide will help you plan, design and execute efficient load testing using WebLOAD.
It will help you:
If you are totally new to load testing I suggest that you read the 2 following resources below:
4
WebLOAD Components and Architecture
WebLOADs key components include:
System
Cloud
Under Test
Load Generators
IDE
Web
Servers
Console Application
Servers
On Premise
Load Generators
DB
Dashboard Analytics
5
WebLOAD Components and Architecture
WebLOAD IDE
You create your scenario/script - called Agenda in WebLOAD - via the WebLOAD IDE recorder, or directly script it using
WebLOAD IDE editor. Using the IDE, you can define correlations, validations and parameterization, and define special
parameters that affect the behavior of your scenarios. If these concepts are new to you, dont worry, they are all clarified
later on in this document.
When you save your Agenda it is saved as a WebLOAD Project File (.wlp). It is recommended to test your created
Agenda in WebLOAD IDE prior to the real load test. If you save your Agenda after you run it in the WebLOAD IDE it will
be saved in WebLOAD Session file (.wls). While the .wlp file contains the agenda including all the recording information,
the .wls includes all the recording and execution information that is gathered by WebLOAD IDE during the execution of
the Agenda.
WebLOAD Console
Using the WebLOAD Console you define the test to be executed by defining a Template (.tpl).
A template, which represents a whole test, defines:
The agendas to be executed.
The number of virtual users to be used on a specific schedule.
The Load Generators (LG) machines and cloud LG machines.
Probing Client machines.
Performance Measurements of your servers to be collected during your test.
Once the test execution is completed, you can save the test results into a load session file (.ls).
6
WebLOAD Components and Architecture
7
WebLOAD Deployment
A typical WebLOAD deployment consists of the
following:
8
WebLOAD Deployment
WebLOAD Dashboard
The WebLOAD Dashboard is typically installed as part The following diagram illustrates example of distributed
of the console machine but it can also be deployed deployment of WebLOAD:
on a dedicated machine. The WebLOAD Dashboard is
automatically attached to the local PostgreSQL.
In order to show currently running sessions - In
WebLOAD Console, go to Load Generators
WebLOAD Distributed & Probing Clients
Deployment Example
Tools Global options Database
Dashboard
Cloud
and set the checkbox Insert Statistics into
PostgreSQL database during the session.
On-
Premises
PostgreSQL
9
Planning Your Tests
Before you get into your car, you always know where youre going. The same applies in load testing.
Planning is critical and prior to creating any test, you should ask yourself:
All of these and more must be clear ahead of time. Otherwise, youll find yourself running around in circles
without making any real progress.
A full blown book can be written on planning load testing but here are a few essential guidelines:
TIP Do not forget to simulate any periodical/background processes in your real environment. They
may affect your users while they are running.
TIP You may need to disable some features in your application. For example, if you have integration
with a payment system, you do not want your test to make a payment. Or if you simulate book ordering,
you do not want items to be shipped to virtual users!
10
Planning Your Tests
12
Building Agenda Using WebLOAD IDE
Record
The most common usage is to record your agendas WebLOAD records your activity in Incognito mode in
using WebLOAD proxy recorder. When you click the Chrome (In-Private in IE), which means that your cache
record button, you can select which browser to use for and cookies are ignored. In this situation your activity is
the recording, and you can also identify your session as recorded as a new user who is doing an activity.
it was done by a browser or by a mobile device. TIP HTTP traffic is being recorded by WebLOADs
proxy, using the default port 9884. If this port is used by
another process, change it via
Tips
Begin/End Transaction. Transaction is an
important term in load testing, as it represents
a certain activity that you might want to measure, for
example, login, buy stock, etc. That activity can be
built from one HTTP request, or a few HTTP requests
or others. You might want to wrap the relevant HTTP
requests with Begin/End Transaction.
Filtering. The proxy recorder records all the traffic that
goes from the browser. There are redundant URLs that
you may want to filter out from your test. For example,
there are ads that are directed to an external site, or a
Make sure that a small toolbar named WebLOAD browser plug-in that performs some activity. WebLOAD
Recording is opened automatically where you can control can filter these activities from the recorded session.
the recording, add transactions, add messages, etc. Go to
Recording and Script URL
Tools
Generation Options Filtering
13
Building Agenda Using WebLOAD IDE
Script Manipulation
Agenda Tree Pane and JavaScript View TIP Right click in your script to easily insert WebLOAD
variables and methods to your script.
You can see the recorded agendas via 2 main views: TIP for advanced users: WebLOAD has special
methods such as InitAgenda that runs once for each
Tree Pane on the left execution, or InitClient that runs once per each client,
JavaScript View on the right etc. You can create these methods by selecting these
Functions at the top of the JavaScript View, and write
These 2 views are correlated. Clicking on a specific node on your JavaScript special code. To learn more about
the tree will present the node related script on the JavaScript WebLOAD methods flow, it is recommended to drill
View to be edited. Clicking on the tree root will present the down into the documentation.
entire JavaScript code. To edit the entire script, press the full
script button.
14
Building Agenda Using WebLOAD IDE
Tips
It is recommended to go over the WebLOAD Scripting Guide doc, in
order to learn more about these scripting methods and many more.
In order to code in your script, you can add a code to any recorded
node, but it may be convenient also to drag and drop JavaScriptObject
to the tree, and you can code there anything youd like. This way you
can keep the structure of the tree while adding the JavaScript segment
you need.
You can save your reused JavaScript methods in a .js file, and when
needed use the IncludeFile method. A good example for such a
usage may be login and logout which are common to all application
activities.
15
Building Agenda Using WebLOAD IDE
Correlation
Correlation is an important concept in Load Testing. It
addresses the conflict between the fact that servers keep
track of client sessions and add dynamic values to the clients
sessions on one hand, and the fact that these dynamic values
become static in a recorded script on the other hand. The
script needs to be changed in order to get rid of these values
and make the script dynamic values friendly. A good example
of this is SessionID, which is unique to every client. It cannot
use the recorded SessionID. Doing so will cause errors.
This will open a screen with all fields which are suspected as TIP WebLOAD helps you define the
dynamic values that need to be correlated. Now, you can mark necessary rules for future recordings. It
which rule should be used. shows for each value whether it was found
by a predefined and Active rule. WebLOAD
also shows whether a value was found by its
enhanced automatic algorithm that scans
the pages and looks for more sophisticated
values - these values are presented as
Temporary. If you find a temporary rule as
one that should work for future recordings
as well, make it Permanent via the
dropdown menu.
17
Building Agenda Using WebLOAD IDE
Parameterization
Parameters are your way to create real life
scenarios. For example, you would like to create
a load test with 1000 different virtual users at
the same time. Youll need to create different
login details - username and password - for
every virtual user. Not using parameters may
cause errors in the best case or an inaccurate
test in the worst case.
18
Building Agenda Using WebLOAD IDE
Response Validation
In load testing it is important to validate the correctness of the responses and not just keep track of performance. This
ensures that the server is functioning correctly, even under load. For more details, read the blogpost:
www.radview.com/blog/validation-during-load-testing-trust-but-verify/
WebLOAD lets you verify response values by coding validations directly in the script or by using the Response Validation
feature. When you are focused on a certain node, working in Page View or HTML View of each node, you can right click and
open the response validation window. You can then define validation for a certain value in the page, set a time limit to the
page, decide how to proceed when validation fails, etc.
19
Building Agenda Using WebLOAD IDE
TIP When you run your script you can see side by side and compare the server
response during current execution and during the recording phase.
20
Executing an Agenda Using
the WebLOAD Console
The WebLOAD Console lets you manage load testing execution by choosing the agendas, the load
generation machines, the load profile (virtual users throughout the test), etc.
Before defining test execution parameters, bear in mind your test goals and requirements. How many virtual users, which
activities, in which percentages, from which locations, etc. In addition, server performance measurement that you would like
WebLOAD to collect for you, etc. Here are a few tips:
TIP Test your system first in low volume with only one TIP Document your tests. Performance testing
Agenda (do not mix). It is easier to find the root cause in a is an iterative process and youll be running tests
simple test, and in most cases there are issues that can be multiple times, modifying settings and running again.
easily found this way. For example, it is far more difficult to It is easy to get confused without detailed tracking of
find root cause when you run a mix of 20 agendas, than when what were the goals and exact settings each run. So
running one agenda only. Start small and grow. Only after you document your tests - what was running, why it was
are satisfied with the low volume, increase it and mix it to your running, what was changed from previous test, etc. It
test targets. will save you a lot of time during the triage process.
TIP In the agile world you perform tests on the system TIP Plan enough time for running performance
while its being developed. You dont have to wait until you tests. Running tests, making changes to the
have full system to start testing it. You can test performance environment, fixing, re-running and analyzing results
in your first iteration, when you have one service ready, and consumes time.
move on from there to other services. You definitely do not
need to wait until the very end of your development when
performance testing at this point may be too late. With the
richness and flexibility of WebLOAD scripting you can test any
partial ready service and manipulate the test to your specific
condition.
21
Executing an Agenda Using the WebLOAD Console
22
Executing an Agenda Using the WebLOAD Console
Mix
In WebLOAD you can select several agendas and dedicate load Add agenda files to the mix, set their weight, and the
generators. But you can also define a mix of agendas to run other configurations. Once your mix is defined, save it
with a certain distribution between them, and easily define in a .mix file. From now on, you manage the mix entity
machines and schedule for all of them together rather than by and select it in your test, like any standard agenda.
one to one.
You can also add a few mix files and a few agendas in
First, define your mix by selecting the Mix Creation button the same test. For example, executing one mix from
from the console top edit bar. It opens the following window: a few machines, executing a second mix from other
machines, and specific agendas on yet other machines.
This powerful capability gives you the option to reach
the most enhanced agenda combination you need, with
the most enhanced configuration.
23
Executing an Agenda Using the WebLOAD Console
24
Executing an Agenda Using the WebLOAD Console
Tips
Do not overload your LGs. WebLOAD console lets you You can dynamically change the number of virtual
define as many virtual users as you want for a specific users during test execution, overriding the templates
machine. Note that the machine can be weak and scheduling:
therefore cannot handle the number of virtual users
you defined. If one or more of your load generators is Session Throttle
overloaded during a test, the results may be worthless. Control
For more information, read the following the blogpost: You can change the number of virtual users.
http://www.radview.com/blog/how-to-to-detect-
overloaded-load-generators-in-load-testing. Session Freeze
Make sure that the LG machines are clean from other
jobs and currently running processes. This can reduce the You can freeze the progress of your session you
load used power, and skew results. continue testing with the current number of virtual
users and the template time does not continue.
You can combine profiles in your session. For example,
These two features are time savers. When you want
step increment, then perform ramp up profile, and
to investigate your systems behavior on specific load
more.
size, you can freeze, change the load, and continue
from where you froze your test - without the need to
stop the test, and execute it again.
25
Executing an Agenda Using the WebLOAD Console
Your LG machines are doing a lot of work simulating You can also put several probing client machines in
many virtual users. This means that load machines may different locations so you can see the results from
be noisy. If you want to look at the response time different locations. A probing client can execute any
and transaction times, or any other timers without the agenda LG can execute, without any limitations.
overhead of the load generator, it is recommended to see
the results from a machine that runs only a single user. Another interesting way to use the probing client is by
This way you can see how a single user experiences your executing a real browser or mobile device. This way, you
server performance, without the noise. load your servers with Load Generators, and measure
the real user experience from a browser or from a real
A machine that runs a probing client, by definition, should mobile device. WebLOAD lets you run real browsers
not be loaded by itself. Thus, the probing client machine and devices by integrating with 3rd party functional
can act as a good indication whether your servers or your testing tools such as Selenium, Ranorex, Original
LGs are overloaded. For example, you see on a certain Softwares TestDrive, Perfecto Mobile, etc. WebLOAD
LG machine the response time goes up while increasing activates these tools, runs the browser activity, and
the load. Does it mean that your server reached its max collects performance statistics from the browser or
capacity? Not necessarily. Your LG may be overloaded the mobile device. This is also a great way to make
(bandwidth/memory/CPU). So, take a look at the probing sure that your functional tests pass/fail under load. To
client. If its response time increasing as well, it means that learn about each of the integrations, read WebLOAD
your server is choking. If not - your LG. documentation.
26
Executing an Agenda Using the WebLOAD Console
27
Executing an Agenda Using the WebLOAD Console
28
Executing an Agenda Using the WebLOAD Console
You can define success/failures criteria based on many factors such as failure of the entire
session, errors and warning, validations, performance measurements, etc. This provides the
flexibility to adjust and determine how changes in performance will affect the next step in your
continuous delivery pipeline.
Automated mails provide a daily summary of build performance status, comparing results to
the previous automated builds and to a predefined baseline.
29
Load Test Results Analysis
Explaining all the nuances involved in analyzing performance test results requires a dedicated book.
The following, therefore, only highlights some of the key issues. For a more in-depth discussion,
view our webinar How to Interpret Load Test Results.
30
Load Test Results Analysis
31
Load Test Results Analysis
Throughput
Throughput is also a measurement that tells a lot about your servers behavior. For example, when throughput drops
suddenly, or when it is steady where it should grow. Take a look at the following example how throughput is affecting
response time. The system behaves perfectly at the beginning. The load size grows while the response time stays at the
same level. But then, the throughput hit a limit. Once it reaches that limit, the response time grows. The reason, in this
case was a network configuration issue that limited the capacity.
32
Load Test Results Analysis
On the top left panel, you can see the currently viewed report name and its charts - in this example,
Summary Report. You can select any chart to be viewed either from the top left panel, or by selecting
a tab on top of the Chart View.
You can select any report from the left-bottom Gallery panel. The Gallery panel is built from
Templates and Portfolios. A Template is a Chart definition, while a Portfolio, which is a collection of
Templates, is a Report definition. Note, that WebLOAD Analytics lets you see a full report with all its
charts, or one chart only. Just double click on a Template or Portfolio in the Gallery Panel.
34
Analyze Your Test Results with WebLOAD Analytics
You can also edit one of the predefined Charts, and save Save Chart
the new edited Chart as a new Template in the same way File
as Template
To create new Portfolio or update a Portfolio, right click in the Gallery tree or drag and drop a
Template into a Portfolio.
TIP Note that all the changes you make are done on the currently viewed report, and do not
affect any template or portfolio, unless you save your changes.
If you want to publish a full Report (and not a Chart only), use the Publish Report option
from the File menu.
35
WebLOAD Dashboard
The WebLOAD Dashboard allows presenting and analyzing load tests results from any browser
or a mobile device. It is also a convenient tool for sharing information, working with colleagues
in parallel on the same tests results while each user sees different angles of the same test.
You can configure many Dashboards, each presenting different data. In the example above we
configured a dashboard named default. You can adjust the Dashboard you configure to your needs.
A dashboard is built with rows and panels. In the above example there are 3 rows. In the first row you
can see 3 panels.
A panel can be of several types: Graph, SingleStat, Text, Log. In the above example you can see four
graphs, one SingleStat, and one Log.
36
WebLOAD Dashboard
You can add a new Panel to a row, by selecting To add a new row, select Use the icons on the top right
the green marker on left of each row. the add a row button at to open a different Dashboard,
the bottom right of each create a new Dashboard, etc.
Dashboard.
37
WebLOAD Dashboard
Besides uploading past session, you can view a currently running session. WebLOAD
Console needs to be configured to send statistics information to the PostgreSQL DB during
runtime. See the deployment session to learn how to configure this.
Share Dashboards
When you build an interesting Dashboard with interesting data, you can share it with your
manager or peers by sending a link.
Playlist (Slideshow)
If you want to have live presentation screened, you can create a list of favorite Dashboards,
via the Mark as favorite in the save menu. Starting the playlist can be reached when
clicking the folder icon.
38
We hope this document will help you to get
started with WebLOAD. If you have any questions
about WebLOAD, we would love to hear from you.
Have you and your team come up with your own
WebLOAD best practices?
Share them with us!
The WebLOAD Team