Examples on LoadRunner Regular Expressions

How to use Regular Expressions in LoadRunner.

Introduction:
The present article is a summarizing of the LoadRunner Regular Expressions challenge and its results. Also, I added code for RegExp patterns/subpatterns matching.
All LoadRunner Regular Expressions functions are shown with examples.

Outline:

  1. How to check - whether RegExp pattern matches against a text or not
  2. How to get a matched strings (RegExp patterns and subpatterns)

How to check - Whether RegExp pattern matches against a text or not


I thanks Charlie Weiblen and Tim Koopmans for the solution. I modified it slightly.
So, here it is:

  1. Download and unpack Binaries and Developer files for PCRE (Perl Compatible Regular Expressions).
    These and others files are available on Pcre for Windows page.
  2. Unzip downloaded archives into c:\pcreC:\pcre folder
  3. Сomment out the include for stdlib.h file in:
    • C:\pcre\include\pcre.h
    • C:\pcre\include\pcreposix.h
    Commented stdlib.h file
  4. In your LoadRunner script, add to globals.h:
    • #include "c:\\pcre\\include\\pcre.h"
    • #include "c:\\pcre\\include\\pcreposix.h"
    Edited globals.h file
  5. Add the match() function to vuser_init section:

    //////////////////////////////////////////////////////////////////////////
    /// 'match' function matches a 'pattern' against a given 'subject'
    /// It returns 1 for a match, or 0 for a non-match / error
    int match(const char *subject, const char *pattern)
    {
    int rc; // Returned code
    regex_t re; // Compiled regexp pattern

    lr_load_dll("c:\\pcre\\bin\\pcre3.dll");

    if (regcomp(&re, pattern, 0) != 0)
    return 0; // Report error

    rc = regexec(&re, subject, 0, NULL, 0);
    regfree(&re);

    if (rc != 0)
    return 0; // Report error
    else
    return 1;
    }

  6. Let's run sample LoadRunner script and check the result:
    As you can see, match() function works correctly. Using match() function, you can check - whether RegExp pattern matches against a text or not.

    It can be helpful, when you verify in LoadRunner that the text (RegExp pattern) matches the text on a downloaded page.

    I tested the match() function with different patterns and subject strings:
    #Subject stringPatternsResult of
    match()
    Is correct
    result?
    1abcdefb(c(.*))e1Yes
    2abcdefb(z(.*))e0Yes
    32008\\d{2,5}1Yes
    42008\\d{5}0Yes
    5abc 1st of May 2008xyz\\d.*\\d1Yes
    Note: Since LoadRunner uses ANSI C language, please do not forget to double backslashes (\\). For example, to match any digit character (0-9), use pattern "\\d".

    match() function is simple enough. But it searches only and it cannot extract matched subpatterns from the text. For example, we have to extract the name of month from these strings:
    • "abc 1st of May 2008xyz"
    • "abc 25th of February 2031"
    • etc
    We can use the following pattern:
    • \d.+([A-Z]\w+)\s+\d{4}

    The name of month will be matches by subpattern ([A-Z]\w+). How to extract the found text? You can use matchex() function for that. Let's discuss it in details...
How to get a matched strings (RegExp patterns and subpatterns)

To get a matched (found) strings, we have to update our match() function.
That's why I created matchex() ('match' EXtended) function.

  1. Add the matchex() function to vuser_init section
    //////////////////////////////////////////////////////////////////////////
    /// 'matchex' (EXtended) function matches a 'pattern' against a given 'subject'
    /// It returns number of matches:
    /// 0 - for a non-match or error
    /// 1 and more - for successful matches
    int matchex(const char *subject, const char *pattern, int nmatch, regmatch_t *pmatch)
    {
    int rc; // Returned code
    regex_t re; // Compiled regexp pattern

    lr_load_dll("c:\\pcre\\bin\\pcre3.dll");

    if (regcomp(&re, pattern, 0) != 0)
    return 0; // Report error

    rc = regexec(&re, subject, nmatch, pmatch, 0);
    pcre_free(&re); // Release memory used for the compiled pattern

    if (rc < 0)
    return 0; // Report error

    // Get total number of matched patterns and subpatterns
    for (rc = 0; rc < nmatch; rc++)
    if (pmatch[rc].rm_so == -1)
    break;

    return rc;
    }

  2. Let's run sample LoadRunner script and check the result:
    matchex() function returns a number of matched patterns/subpatterns and fill an array in with information about each matched substring.


    What is an information about each matched substring?


    This info contains the offset (rm_so) to the first character of each substring and the offset (rm_eo) to the first character after the end of each substring, respectively.

    Note1: 
    The 0th element of the array relates to the entire portion of string that was matched.
    Note2: Subsequent elements of the array relate to the capturing subpatterns of the regular expression.
    Note3: Unused entries in the array have both structure members set to -1.

    Let's investigate it with the example. This is our subject string:
    ExampleThe replay log shows offsets for matched substrings:
    • Action.c(7): Matched 3 patterns
    • Action.c(10): Start offset: 1, End offset: 6
    • Action.c(10): Start offset: 2, End offset: 5
    • Action.c(10): Start offset: 3, End offset: 5

    Start offset: 1 and End offset: 6 match substring "bcdef".
    Note4: End offset is the first character after the end the current substring. That's why character "g" (with index 6) is not a part of matched string.

    As I've written in Note1, "bcdef" is the entire portion of string that was matched.
    Others items from an array relate to matched subpatterns.


    What is a subpattern in Regular Expression?
    It is a part of the RegExp pattern surrounded with parenthesis - "(" and ")".

    It's easy to get out the order of subpatterns. Just look through your pattern from left to right. When you find an open parenthes, this is a start of the current subpattern.
    Subpattern can be embedded.

    So, others captured subpatterns are:
    • Start offset: 2, End offset: 5 matches substring "cde".
      Note: current subpattern is "([acqz](.*))".
    • Start offset: 3, End offset: 5 match substring "de".
      Note: current subpattern is "(.*)".

    As you can see - this is not so difficult. :)
    Regular Expressions can be very powerful and useful in LoadRunner.
Another example:

Let's practise with an example I mentioned early:
For example, we have to extract the name of month from these strings:

  • "abc 1st of May 2008xyz"
  • "abc 25th of February 2031"
  • etc
We can use the following pattern:
  • \d.+([A-Z]\w+)\s+\d{4}
The name of month will be matches by subpattern ([A-Z]\w+).

Please, see LoadRunner script, which captures and prints name of months:




Note: Pay attention that I use   arr[1] to get info about substring.

As you remember, arr[0] contains info about the entire matched pattern, arr[1], arr[2], and so on contain info about matched subpattern.

LoadRunner unique file name with web_save_timestamp_param function

Earlier, I shown two ways how to create unique file names in LoadRunner:

How to get unique file name in LoadRunner :

Generating unique file name using LoadRunner parameter

Today I'm going to show the simplest way. And I would like to thank Charlie for his comment.

He suggested to use web_save_timestamp_param function.

web_save_timestamp_param function saves the current timestamp to LoadRunner parameter. Timestamp is the number of milliseconds since midnight January 1st, 1970 (also known as Unix Epoch).

This is how web_save_timestamp_param works:

web_save_timestamp_param("TimeStamp", LAST);
lr_output_message("Timestamp: %s", lr_eval_string("{TimeStamp}"));
And the result is:
Results in LoadRunner Generator
As I explained in this loadRunner tutorial about unique file names in LoadRunner, we have to get unique ids per virtual users with lr_whoamiLoadRunner function.

So, the final LoadRunner script is:
char szFileName[256];
int vuserid, scid;
char *groupid;

lr_whoami(&vuserid, &groupid, &scid); web_save_timestamp_param("TimeStamp", LAST); 

sprintf(szFileName, "%s_%d_%d_%s",
    lr_eval_string("{TimeStamp}"), 
    vuserid,
 
    scid,
 
    groupid);


lr_output_message("File name: %s", szFileName);
And its result is from LoadRunner Controller:Results in LoadRunner ControllerSo, you can add a required file extension (txt, pdf, etc) and get a unique file name. It will work for any number of concurrent virtual users in LoadRunner Controller.

All about web_url and web_link in LoadRunner

    Points to note with web_url and web_link:

    web_url is not a context sensitive function while web_link is a context sensitive function. Context sensitive functions describe your actions in terms of GUI objects (such as windows, lists, and buttons). Check HTML vs URL recording mode.
    If web_url statement occurs before a context sensitive statement like web_link, it should hit the server, otherwise your script will get error’ed out.
    While recording, if you switch between the actions, the first statement recorded in a given action will never be a context sensitive statement.
    The first argument of a web_link, web_url, web_image or in general web_* does n
  • ot affect the script replay. For example: if your web_link statements were recorded as
    Now, when you parameterize/correlate the first argument to
    On executing the above script you won’t find the actual text of the parameter {Welcome to Learn LoadRunner} instead you will find {Welcome to Learn LoadRunner} itself in the execution log. However to show the correlated/parameterized data you can uselr_eval_string to evaluate the parameter

How Domain Knowledge is important for a tester?

First of all I would like to introduce three dimensional testing career .There are three categories of skill that need to be judged before hiring any software tester. What are those three skill categories?
1) Testing skill
2) Domain knowledge
3) Technical expertise.


No doubt that any tester should have the basic testing skills like Manual testing and Automation testing. Tester having the common sense can even find most of the obvious bugs in the software. Then would you say that this much testing is sufficient? Would you release the product on the basis of this much testing done? Certainly not.You will certainly have a product look by the domain expert before the product goes into the market.

While testing any application you should think like a end-user. But every human being has the limitations and one can’t be the expert in all of the three dimensions mentioned above. (If you are the experts in all of the above skills then please let me know ;-)) So you can’t assure that you can think 100% like how the end-user going to use your application. User who is going to use your application may be having a good understanding of the domain he is working on. You need to balance all these skill activities so that all product aspects will get addressed.

Nowadays you can see the professional being hired in different companies are more domain experts than having technical skills. Current software industry is also seeing a good trend that many professional developers and domain experts are moving into software testing.

We can observe one more reason why domain experts are most wanted! When you hire fresh engineers who are just out of college you cannot expect them to compete with the experienced professionals. Why? Because experienced professional certainly have the advantage of domain and testing experience and they have better understandings of different issues and can deliver the application better and faster.

Here are some of the examples where you can see the distinct edge of domain knowledge: 
1) Mobile application testing.
2) Wireless application testing
3) VoIP applications
4) Protocol testing
5) Banking applications
6) Network testing


How will you test such applications without knowledge of specific domain? Are you going to test the BFSI applications (Banking, Financial Services and Insurance) just for UI or functionality or security or load or stress? You should know what are the user requirements in banking, working procedures, commerce background, exposure to brokerage etc and should test application accordingly, then only you can say that your testing is enough - Here comes the need of subject-matter experts.

Let’s take example of my current project: I am currently working on a project based on E-learning and which is a complete LMS (Learning Management System). If a tester do not have the domain knowledge or if he doesn't know what is "assessments" , "standards" and "prescription" , then how can he test that application.

When I know the functional domain better I can better write and execute more test cases and can effectively simulate the end user actions which is distinctly a big advantage.

Here is the big list of the required testing knowledge: 
  • Testing skill 
  • Bug hunting skill 
  • Technical skill 
  • Domain knowledge 
  • Communication skill 
  • Automation skill 
  • Some programming skill 
  • Quick grasping 
  • Ability to Work under pressure … 
That is going to be a huge list. So you will certainly say, do I need to have these many skills? Its’ depends on you. You can stick to one skill or can be expert in one skill and have good understanding of other skills or balanced approach of all the skills. This is the competitive market and you should definitely take advantage of it. Make sure to be expert in at least one domain before making any move.

What if you don’t have enough domain knowledge?

You will be posted on any project and company can assign any work to you. Then what if you don’t have enough domain knowledge of that project? You need to quickly grasp as many concepts as you can. Try to understand the product as if you are the customer and what customer will do with application. Visit the customer site if possible know how they work with the product, Read online resources about the domain you want to test the application, participate in events addressing on such domain, meet the domain experts. Or either company will provide all this in-house training before assigning any domain specific task to testers.

There is no specific stage where you need this domain knowledge. You need to apply your domain knowledge in each and every software testing life cycle.

If there are no requirements, how will you write your test plan?

If there are no requirements we try to gather as much details as possible from:

  • Business Analysts
  • Developers (If accessible)
  • Previous Version documentation (if any)
  • Stake holders (If accessible)
  • Prototypes

How to calculate sessions per hour in performance testing? - Little's Law

Calculating Sessions per hour: For this discussion, we will be focusing on a session as the total time for the user group to finish one complete set of transactions. We may wish to know the number sessions that will be completed for any given number of virtual users. 

Example 1:- If a baseline test shows that a User Type takes a total of 120 seconds for a session, then in an hour long steady state test this User Type should be able to complete 3600 / 120 = 30 sessions per hour. Twenty of these users will complete 20 x 30 = 600 of these session in an hour. In other cases, we have a set number of sessions we want to complete during the test and want to determine the number of virtual users to start. 

Example 2:Using the same conditions in our first example, if our target session rate for sessions per hour is 500, then 500 / 30 = 16.7 or 17 virtual users. A formula called Little's Law states this calculation of Virtual Users in slightly different terms. 
Using Little's Law with Example 2:

V.U. = R x D 
where R = Transaction Rate and
D = Duration of the Session
If our target rate is 500 sessions per hour (.139 sessions/sec) and our duration is 120 seconds, then Virtual Users = .139 x 120 = 16.7 or 17 virtual users.

Case Studies – Identifying Performance-testing Objectives

Case Study 1 Scenario

A 40-year-old financial services company with 3,000 employees is implementing its annual Enterprise Resource Planning (ERP) software upgrade, including new production hardware. The last upgrade resulted in disappointing performance and many months of tuning during production.


Performance Objectives

The performance-testing effort was based on the following overall performance objectives:
Ensure that the new production hardware is no slower than the previous release.
Determine configuration settings for the new production hardware.
Tune customizations. 

Performance Budget/Constraints

The following budget limitations constrained the performance-testing effort:
No server should have sustained processor utilization above 80 percent under any anticipated load. (Threshold)
No single requested report is permitted to lock more than 20 MB of RAM and 15-percent processor utilization on the Data Cube Server.
No combination of requested reports is permitted to lock more than 100 MB of RAM and 50-percent processor utilization on the Data Cube Server at one time. 

Performance-Testing Objectives

The following priority objectives focused the performance testing:
Verify that there is no performance degradation over the previous release.
Verify the ideal configuration for the application in terms of response time, throughput, and resource utilization.
Resolve existing performance inadequacy with the Data Cube Server.

Questions
  1. The following questions helped to determine relevant testing objectives: 
  2. What is the reason for deciding to test performance? 
  3. In terms of performance, what issues concern you most in relation to the upgrade? 
  4. Why are you concerned about the Data Cube Server? 
Case Study 2
Scenario

A financial institution with 4,000 users distributed among the central headquarters and several branch offices is experiencing performance problems with business applications that deal with loan processing.
Six major business operations have been affected by problems related to slowness as well as high resource consumption and error rates identified by the company’s IT group. The consumption issue is due to high processor usage in the database, while the errors are related to database queries with exceptions.

Performance Objectives
  • The performance-testing effort was based on the following overall performance objectives: 
  • The system must support all users in the central headquarters and branch offices who use the system during peak business hours. 
  • The system must meet backup duration requirements for the minimal possible timeframe. 
  • Database queries should be optimal, resulting in processor utilization no higher than 50-75 percent during normal and peak business activities. 
Performance Budget/Constraints

The following budget limitations constrained the performance-testing effort:
  • No server should have sustained processor utilization above 75 percent under any anticipated load (normal and peak) when users in headquarters and branch offices are using the system. (Threshold) 
  • When system backups are being performed, the response times of business operations should not exceed 8 percent, or the response times experienced when no backup is being done. 
  • Response times for all business operations during normal and peak load should not exceed 6 seconds. 
  • No error rates are allowable during transaction activity in the database that may result in the loss of user-submitted loan applications. 
Performance-Testing Objectives

The following priority objectives focused the performance testing:
  • Help to optimize the loan-processing applications to ensure that the system meets stated business requirements. 
  • Test for 100-percent coverage of the entire six business processes affected by the loan-manufacturing applications. 
  • Target database queries that were confirmed to be extremely sub-optimal, with improper hints and nested sub-query hashing. 
  • Help to remove superfluous database queries in order to minimize transactional cost. 
  • Tests should monitor for relevant component metrics: end-user response time, error rate, database transactions per second, and overall processor, memory, network, and disk status for the database server. 
Questions
  1. The following questions helped to determine relevant testing objectives: 
  2. What is the reason for deciding to test performance? 
  3. In terms of performance, what issues concern you most in relation to the queries that may be causing processor bottlenecks and transactional errors? 
  4. What business cases related to the queries might be causing processor and transactional errors? 
  5. What database backup operations might affect performance during business operations? 
  6. What are the timeframes for back-up procedures that might affect business operations, and what are the most critical scenarios involved in the time frame? 
  7. How many users are there and where are they located (headquarters, branch offices) during times of critical business operations? 

These questions helped performance testers identify the most important concerns in order to help prioritize testing efforts. The questions also helped determine what information to include in conversations and reports.

Case Study 3
Scenario

A Web site is responsible for conducting online surveys with 2 million users in a one-hour timeframe. The site infrastructure was built with wide area network (WAN) links all over the world. The site administrators want to test the site’s performance to ensure that it can sustain 2 million user visits in one hour. 

Performance Objectives

The performance-testing effort was based on the following overall performance objectives:
The Web site is able to support a peak load of 2million user visits in a one-hour timeframe.
Survey submissions should not be compromised due to application errors. 

Performance Budget/Constraints

The following budget limitations constrained the performance-testing effort:
No server can have sustained processor utilization above 75 percent under any anticipated load (normal and peak) during submission of surveys (2 million at peak load).
Response times for all survey submissions must not exceed 8 seconds during normal and peak loads.
No survey submissions can be lost due to application errors. 

Performance-Testing Objectives

The following priority objectives focused the performance testing:
  • Simulate one user transaction scripted with 2 million total virtual users in one hour distributed among two datacenters, with 1 million active users at each data center. 
  • Simulate the peak load of 2 million user visits in a one-hour period. 
  • Test for 100-percent coverage of all survey types. 
  • Monitor for relevant component metrics: end-user response time, error rate, database transactions per second, and overall processor, memory, network and disk status for the database server. 
  • Test the error rate to determine the reliability metrics of the survey system. 
  • Test by using firewall and load-balancing configurations.

Questions


  1. The following questions helped to determine relevant testing objectives: 
  2. What is the reason for deciding to test performance? 
  3. In terms of performance, what issues concern you most in relation to survey submissions that might cause data loss or user abandonment due to slow response time? 
  4. What types of submissions need to be simulated for surveys related to business requirements? 
  5. Where are the users located geographically when submitting the surveys?

Test Strategy Vs Test Planning

Test Strategy:

A Test Strategy document is a high level document and normally developed by project manager. This document defines “Testing Approach” to achieve testing objectives. The Test Strategy is normally derived from the Business Requirement Specification document(BRS).

The Test Stategy document is a static document meaning that it is not updated too often. It sets the standards for testing processes and activities and other documents such as the Test Plan draws its contents from those standards set in the Test Strategy Document.
Some companies include the “Test Approach” or “Strategy” inside the Test Plan, which is fine and it is usually the case for small projects. However, for larger projects, there is one Test Strategy document and different number of Test Plans for each phase or level of testing.

Components of the Test Strategy document :
  • Scope and Objectives 
  • Business issues 
  • Roles and responsibilities 
  • Communication and status reporting 
  • Test deliverability 
  • Industry standards to follow 
  • Test automation and tools 
  • Testing measurements and metrices 
  • Risks and mitigation 
  • Defect reporting and tracking 
  • Change and configuration management 
  • Training plan 

Test Plan:

The Test Plan document on the other hand, is derived from the Product Description, Software Requirement Specification(SRS), or Use Case Documents.

The Test Plan document is usually prepared by the Test Lead or Test Manager and the focus of the document is to describe what to test, how to test, when to test and who will do what test.
It is not uncommon to have one Master Test Plan which is a common document for the test phases and each test phase have their own Test Plan documents.

There is much debate, as to whether the Test Plan document should also be a static document like the Test Strategy document mentioned above or should it be updated every often to reflect changes according to the direction of the project and activities.

My own personal view is that when a testing phase starts and the Test Manager is “controlling” the activities, the test plan should be updated to reflect any deviation from the original plan. After all, Planning and Control are continuous activities in the formal test process. 

Components of the Test Strategy document :
  • Test Plan id 
  • Introduction 
  • Test items 
  • Features to be tested 
  • Features not to be tested 
  • Test techniques 
  • Testing tasks 
  • Suspension criteria 
  • Features pass or fail criteria 
  • Test environment (Entry criteria, Exit criteria) 
  • Test delivarables 
  • Staff and training needs 
  • Responsibilities 
  • Schedule 
This is a standard approach to prepare test plan and test strategy documents, but things can vary company-to-company

Factors Affecting Performance of web application

It has been known for years that although software development constantly strives towards constant improvement, it will never completely be 100% perfect. An application’s performance, in turn, can only be as good as in comparison to its performance objectives.

Performance problems affect all types of systems, regardless of whether they are client/server or Web application systems. It is imperative to understand the factors affecting system performance before embarking on the task of handling them.

Generally speaking, the factors affecting performance may be divided into two large categories: project management oriented and technical.
Project Management Factors Affecting Performance In the modern Software Development Life Cycle (SDLC), the main phases are subject to time constraints in order to address ever growing competition.

This causes the following project management issues to arise:
  •  Shorter coding time in development may lead to a lower quality product due to a lack of concentration on performance.
  •  Chances of missing information due to the rapid approach may disqualify the performance objectives.
  •  Inconsistent internal designs may be observed after product deployment, for example, too much cluttering of objects and sequence of screen navigation.
  • Higher probability of violating coding standards, resulting in unoptimized code that may consume too many resources.
  •  Module reuse for future projects may not be possible due to the project specific design.
  • Module may not be designed for scalability.
  • System may collapse due to a sudden increase in user load.

Technical Factors Affecting Performance
While project management related issues have great impact on the output, technical problems may severely affect the application’s overall performance. The problems may stem from the selection of the technology platform, which may be designed for a specific purpose and does not perform well under different conditions.

Usually, however, the technical problems arise due to the developer’s negligence regarding performance. A common practice among many developers is not to optimize the code at the development stage. This code may unnecessarily utilize scarce system resources such as memory and processor. Such coding practice may lead to severe performance bottlenecks
such as:
  • memory leaks
  • array bound errors
  • inefficient buffering
  • too many processing cycles
  • larger number of HTTP transactions
  • too many file transfers between memory and disk
  • inefficient session state management
  • thread contention due to maximum concurrent users
  • poor architecture sizing for peak load
  • inefficient SQL statements
  • lack of proper indexing on the database tables
inappropriate configuration of the servers
These problems are difficult to trace once the code is packaged for deployment and require special tools and methodologies. Another cluster of technical factors affecting performance is security.
Performance of the application and its security are commonly at odds, since adding layers of security (SSL, private/public keys and so on) is extremely computation intensive. Network related issues must also be taken into account, especially with regard to Web applications. They may be coming from the various sources such as:
  •  Older or unoptimized network infrastructure
  • Slow web site connections lead to network traffic and hence poor response time
  • Imbalanced load on servers affecting the performance

Performance Testing Estimation Preparation

It depends of which estimation techniue you are using...if it is WBS then you will have to break all the performance testing activities in smaller parts then using your prior experience you can estimate no of days for each activities. Also take some time for each activity in spare so that you can get time in case of any environmental or deploymental delay or issue. Incase of WBS following activities can be considered: 

A. Planning 
1. Understanding of application 
2. Identifing of NFR 
3. Finilazing the workload model 
4. setup of test environment and tools& monitors 
5. Preperation of Test plan 

B. Preperation 
1. Creation & validation of Test scripts 
2. Creation of Test Data 
3. Creation of business scenarios 
4. Getting approval 

C. Execution 
1.Run a dummy test 
2. Baseline test 
3. Upgrade or tune the environment (if needed) 
4. baseline test2 
5. final performance run 
6. Analysis 
7. Final performance run2 
8. Benchmarking etc.. 

D. Reporting 
1. Creation of performance test report 
2. Review with seniors or peers 
3. Update the report 
4. Publish the final report. 
5. Getting signoff

Why response time of a page does not equal the sum of its requests

The response time for a page typically differs from the sum of its requests. This does not mean that your data is incorrect. The difference can be caused by concurrent requests, page connection times, inter-request delays, and custom code within a page.

The most common reason for the sum of the individual request times within a page to exceed the total page response time is that requests are often sent concurrently (in parallel) to a server. Thus some of the individual request response times overlap so the sum of the request response times would exceed the page response time.

Additionally, the page response time can exceed the sum of the individual request response times within the page for the following reasons:

  • The individual request response times do not include time to establish connections but the page response time does include the connection request time. 
  • Inter-request delays are not reflected in the individual request response time but are reflected in the page response time. 
  • Custom code placed within a page is executed serially (after waiting for all previous individual requests to complete) and thus contributes to the page response time. It does not affect individual request response times. However, we recommend that you place custom code outside of a page, where it will not affect page response time.

Transactional Concurrency in Load testing

How many transaction will need to run per minute if a load test has to run for 2 hours with 5000 users, assuming average length of transaction if 5 minutes?

Solution:


Duration of load test -120 minutes
User load- 5000
Average Length of transaction- 5 minutes
No. of transaction per minute-?

No. of transaction performed by single user in 120 minute = 120 minutes / 5 minute = 24 transaction

No. of transaction performed in 2 hours by 5000 users = 5000*24 =120000 transactions.

No. of transaction per minute =No. of transaction performed during 2 hour by 5000 users/duration of two hour = 120000/120= 1000 Transaction /Minute