Email - techvision.lr@gmail.com
LoadRunner Training in online/offline mode.
Wednesday, 24 September 2014
Tuesday, 23 September 2014
web_reg_save_param_regexp
Do you have a correlation which you can’t solve because the values of the left and right boundary are dynamic? Correlation is an essential part of performance test scripting and there are plenty of different challenges with correlation. Imagine having a value of “GraphA123567EndGraphA” and the goal is to correlate 123567
From the example above, the left and right boundaries would be “LB=GraphA” “RB=EndGraphA”
What if the word GraphA is dynamic and can be anything from GraphA-GraphZ?
There is a solution at hand!
Using web_reg_save_param_regex will allow the user to grab a correlation value using dynamic left and right boundaries. This function uses the power of regular expressions, below are a few examples:
Example 1:
Source: “GraphA123567EndGraphA”
Solution: web_reg_save_param_regexp(“ParamName=CorrValue”, “RegExp=\“Graph[A-Za-z]\”, \“([0-9]+)\”, \“EndGraph[A-Za-z]\””, LAST);
Result: 123567
Example 2:
Correlate the values from a drop down list of a form
Source: dropdown >>> red, blue, green
Solution: web_reg_save_param_regexp(“ParamName=ColourList”, “RegExp=option=[0-9]+>([A-Za-z])
Correlate up till the end of 642
Source: J\u002blsGd3zj1qdP\u002bvk0vDRaKyJFde5tCa6spDEy08SNab1hP8j5GTs4j6\u002f\u002bTqOwvxMHEQZLWd\u002btu8NlHJrVAarIQ==|634998513832503642″];
Solution: web_reg_save_param_regexp(“ParamName=SecurityString”,”RegExp=\”([A-Z0-9a-z\\\\+]+==\\|[0-9]+)\”\\];”,LAST);
Result:J\u002blsGd3zj1qdP\u002bvk0vDRaKyJFde5tCa6spDEy08SNab1hP8j5GTs4j6\u002f\u002bTqOwvxMHEQZLWd\u002btu8NlHJrVAarIQ==|634998513832503642
Example 4:
Correlate only “634998513832503642” Source:
Solution:
Result: 634998513832503642
So what is a Regular Expression?
Also known as regex, a regular expression is a search string which enables matching of a string. Think of it as an advance searching function which can pick out values from a string of multiple characters.
Examples of regex:
LB/DIG RB/DIG – # will be a wildcard for a numeric value“session_id_##”
Source: rows”:[[“NW,RO,RA","DLY","10/07/2011","10/17/2011","10/01/2011","RA","Y","FR","AMEA","AC","1945","50","50","AC 100IOSH-08","UserDefined","10/07/2011","Reassigned"..."
Solution: web_reg_save_param_regexp("ParamName=ParamValue","RegExp=rows":\[\[“[^"\r\n]*”,”([A-Z]{3})”,”[^"\r\n]*”,”[^"\r\n]*”,”[^\/]+\/[\d]+?\/2011″,”[A-Za-z]*”,”[^"\r\n]*”,”[^"\r\n]*”,”([^"\r\n]*)”,”[^"\r\n]*”,”([^"\r\n]*)”,LAST);
Result:
From the example above, the left and right boundaries would be “LB=GraphA” “RB=EndGraphA”
What if the word GraphA is dynamic and can be anything from GraphA-GraphZ?
There is a solution at hand!
Using web_reg_save_param_regex will allow the user to grab a correlation value using dynamic left and right boundaries. This function uses the power of regular expressions, below are a few examples:
Example 1:
Source: “GraphA123567EndGraphA”
Solution: web_reg_save_param_regexp(“ParamName=CorrValue”, “RegExp=\“Graph[A-Za-z]\”, \“([0-9]+)\”, \“EndGraph[A-Za-z]\””, LAST);
Result: 123567
Example 2:
Correlate the values from a drop down list of a form
Source: dropdown >>> red, blue, green
Solution: web_reg_save_param_regexp(“ParamName=ColourList”, “RegExp=option=[0-9]+>([A-Za-z])
- {ColourList1}=red
- {ColourList2}=blue
- {ColourList3}=green
Correlate up till the end of 642
Source: J\u002blsGd3zj1qdP\u002bvk0vDRaKyJFde5tCa6spDEy08SNab1hP8j5GTs4j6\u002f\u002bTqOwvxMHEQZLWd\u002btu8NlHJrVAarIQ==|634998513832503642″];
Solution: web_reg_save_param_regexp(“ParamName=SecurityString”,”RegExp=\”([A-Z0-9a-z\\\\+]+==\\|[0-9]+)\”\\];”,LAST);
Result:J\u002blsGd3zj1qdP\u002bvk0vDRaKyJFde5tCa6spDEy08SNab1hP8j5GTs4j6\u002f\u002bTqOwvxMHEQZLWd\u002btu8NlHJrVAarIQ==|634998513832503642
Example 4:
Correlate only “634998513832503642” Source:
<em>J\u002blsGd3zj1qdP\u002bvk0vDRaKyJFde5tCa6spDEy08SNab1hP8j5GTs4j6\u002f\u002bTqOwvxMHEQZLWd\u002btu8NlHJrVAarIQ==|634998513832503642"];</em>
|
web_reg_save_param_regexp("ParamName=SecurityString",
"RegExp=\"[A-Z0-9a-z\\\\+]+==\\|([0-9]+)\"\\];",
LAST);
|
So what is a Regular Expression?
Also known as regex, a regular expression is a search string which enables matching of a string. Think of it as an advance searching function which can pick out values from a string of multiple characters.
Examples of regex:
- \d matches a single digit
- \w matches a single word (including alphanumeric characters and underscore)
- [A-Z]+ matches any word which is upper case
- [a-z]+ matches any word which is lower case
- [0-9]+ matches any numeric value
LB/DIG RB/DIG – # will be a wildcard for a numeric value“session_id_##”
- Adding LB/IC/DIG will ignore case
- “LB/IC/DIG=session_id_##=” (e.g. Session_id_20)
- ALNUMIC – ignore case
- ALNUMLC – match only lower case
- ALNUMUC – match only upper case
- If there is a dynamic value for a boundary e.g. “session_id_2” (3,4,5)
- SaveOffSet = 2 (to cover “2=”)
- Web_reg_save_param(“SessionID”, “LB=session_id_”, “RB=\””, “SaveOffSet=2”, LAST);
- PERL based
- LR 11 does not support multiple capture groups however this is now supported in LR 11.52 (example below)
Source: rows”:[[“NW,RO,RA","DLY","10/07/2011","10/17/2011","10/01/2011","RA","Y","FR","AMEA","AC","1945","50","50","AC 100IOSH-08","UserDefined","10/07/2011","Reassigned"..."
Solution: web_reg_save_param_regexp("ParamName=ParamValue","RegExp=rows":\[\[“[^"\r\n]*”,”([A-Z]{3})”,”[^"\r\n]*”,”[^"\r\n]*”,”[^\/]+\/[\d]+?\/2011″,”[A-Za-z]*”,”[^"\r\n]*”,”[^"\r\n]*”,”([^"\r\n]*)”,”[^"\r\n]*”,”([^"\r\n]*)”,LAST);
Result:
- {ParamValue1} = DLY
- {ParamValue2} = AMEA
- {ParamValue3} = 1945
Web_Set_Max_Html_param_Len ()
How can we update the length of the parameter? Web_Set_Max_Html_param_Len ().
Default session id length – 256 Characters
To update length of the parameter
Web_set_max_html_length (“1024“) function is used to set the maximum length to the parameter to update the length of the parameterTypes of performance testing?
Load testing:Load
testing is conducted to verify that your application can meet your
desired performance objectives; these performance objectives are often
specified in a service level agreement (SLA). A load test enables you to
measure response times, throughput rates, and resource-utilization
levels, and to identify your application’s breaking point, assuming that
the breaking point occurs below the peak load condition.
purpose:To verify application behavior under normal and peak load conditions.
Stress testing – involves testing an application under extreme workloads to see how it handles high traffic or data processing .The objective is to identify breaking point of an application
purpose:To verify application behavior under normal and peak load conditions.
Stress testing – involves testing an application under extreme workloads to see how it handles high traffic or data processing .The objective is to identify breaking point of an application
Purpose:To determine or validate an application’s behavior when it is pushed beyond normal or peak load conditions.
Endurance testing – is done to make sure the software can handle the expected load over a long period of time.
Spike testing – tests the software’s reaction to sudden large spikes in the load generated by users.
Spike testing – tests the software’s reaction to sudden large spikes in the load generated by users.
Volume testing
– Under Volume Testing large no. of. Data is populated in database and
the overall software system’s behavior is monitored. The objective is to
check software application’s performance under varying database
volumes.
Scalability testing – The objective of scalability testing is to determine the software application’s effectiveness in “scaling up” to support an increase in user load. It helps plan capacity addition to your software system.Capacity testing:Capacity testing is conducted in conjunction with capacity planning, which you use to plan for future growth, such as an increased user base or increased volume of data. For example, to accommodate future loads, you need to know how many additional resources (such as processor capacity, memory usage, disk capacity, or network bandwidth) are necessary to support future usage levels.
Capacity testing helps you to identify a scaling strategy in order to determine whether you should scale up or scale out.
Scalability testing – The objective of scalability testing is to determine the software application’s effectiveness in “scaling up” to support an increase in user load. It helps plan capacity addition to your software system.Capacity testing:Capacity testing is conducted in conjunction with capacity planning, which you use to plan for future growth, such as an increased user base or increased volume of data. For example, to accommodate future loads, you need to know how many additional resources (such as processor capacity, memory usage, disk capacity, or network bandwidth) are necessary to support future usage levels.
Capacity testing helps you to identify a scaling strategy in order to determine whether you should scale up or scale out.
Purpose:To determine how many users and/or transactions a given system will support and still meet performance goals.
Types of VUsers
Types of VUsers
You can use the Vuser types in any combination in a scenario in order to create a comprehensive client/server test. The following Vuser types are available:
The Vuser types are divided into the following categories:
All Protocols: a list of all supported protocols in alphabetical order.
- Application Deployment Solution: For the Citrix protocol.
- Client/Server: For DB2 CLI, DNS, MS SQL, ODBC, Oracle (2-tier), Sybase
- Ctlib, Sybase Dblib, and Windows Sockets protocols.
- Custom: For C templates, Visual Basic templates, Java templates,
- Javascript and VBscript type scripts.
- Distributed Components: For COM/DCOM, Corba-Java, and Rmi -Java protocols.
- E-business: For FTP, LDAP, Palm, Web (HTTP/HTML), Web Services, and the dual Web/Winsocket protocols.
- Enterprise Java Beans: For EJB Testing and Rmi-Java protocols.
- ERP/CRM: For Baan, Oracle NCA, Peoplesoft-Tuxedo, Peoplesoft 8,
- SAPGUI, SAP-Web, and Siebel (Siebel-DB2CLI, Siebel-MSSQL, Siebel-Web, and Siebel-Oracle) protocols.
- Legacy: For Terminal Emulation (RTE).
- Mailing Services: Internet Messaging (IMAP), MS Exchange (MAPI), POP3, and SMTP.
- Middleware: Jacada and Tuxedo (6, 7) protocols.
- Streaming: For MediaPlayer and RealPlayer protocols.
- Wireless: For i-Mode, VoiceXML, and WAP protocols.
Load generators are controlled by VuGen scripts which issue non-GUI API calls using the same protocols as the client under test. But WinRunner GUI Vusersemulate keystrokes, mouse clicks, and other User Interface actions on the client being tested Only one GUI user can run from a machine unless LoadRunner Terminal Services Manager manages remote machines with Terminal Server Agent enabled and logged into a Terminal Services Client session.
The Status of Vusers on all load generators start from "Running", then go to "Ready" after going through the init section of the script. Vusers are "Finished" in passed or failed end status. Vusers are automatically "Stopped" when the Load Generator is overloaded.
No additional license is needed to monitor standard web (HTTP) servers (Apache, IIS, and Netscape).
To use Web Services Monitors for SOAP and XML, a separate license is needed, and vUsers require the Web Services add-in installed with Feature Pack (FP1)
Monday, 22 September 2014
lr_save_datetime function in Loadrunner
LoadRunner stores date/time parameters locally on the LoadRunner PC. This means that opening a script
on another users PC, where the date/time parameter is not stored, can cause corruption to the date/time
parameters in a script. You know that this has happened when a date/time parameter in this format
[%Y%m%d%H%M%S] is sent to the server rather than the format that you intended.
Due to this problem, It is recommend that the lr_save_datetime function is used to save date or time
values to a string. The string can then be used in the script and the script is portable between PCs because
we are no longer relying on the locally stored parameters.
Sample code
lr_save_datetime("%d/%m/%y", DATE_NOW, "DDMMYY");
lr_output_message("Today's Date is %s",lr_eval_string("{DDMMYY}"));
lr_save_datetime("%d/%m/%Y", DATE_NOW, "DDMMYYYY");
lr_output_message("Today's Date is %s",lr_eval_string("{DDMMYYYY}"));
lr_save_datetime("%B %d %Y", DATE_NOW, "Today");
lr_output_message("Today is %s",lr_eval_string("{Today}"));
lr_save_datetime("%B %d %Y", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%A", DATE_NOW - ONE_DAY, "Yesterday");
lr_output_message("Yesterday was %s",lr_eval_string("{Yesterday}"));
lr_save_datetime("%A", DATE_NOW, "Today");
lr_output_message("Today is %s",lr_eval_string("{Today}"));
lr_save_datetime("%A", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%X", TIME_NOW , "Time");
lr_output_message("The time is %s (in this locale's date format)",lr_eval_string("{Time}"));
lr_save_datetime("%X", TIME_NOW + ONE_HOUR , "Time");
lr_output_message("In one hour it will be %s",lr_eval_string("{Time}"));
lr_save_datetime("%A", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%j", DATE_NOW, "Today");
lr_output_message("Today is day %s in the year",lr_eval_string("{Today}"));
lr_save_datetime("%Z", DATE_NOW, "TimeZone");
lr_output_message("This machine is in the '%s' time zone",lr_eval_string("{TimeZone}"));
lr_save_datetime("%p", DATE_NOW, "AMPM");
if (strcmp (lr_eval_string("{AMPM}"),"PM")!=0)
{
lr_output_message("Good Morning");
}
else
lr_output_message("Good Afternoon");
on another users PC, where the date/time parameter is not stored, can cause corruption to the date/time
parameters in a script. You know that this has happened when a date/time parameter in this format
[%Y%m%d%H%M%S] is sent to the server rather than the format that you intended.
Due to this problem, It is recommend that the lr_save_datetime function is used to save date or time
values to a string. The string can then be used in the script and the script is portable between PCs because
we are no longer relying on the locally stored parameters.
Sample code
lr_save_datetime("%d/%m/%y", DATE_NOW, "DDMMYY");
lr_output_message("Today's Date is %s",lr_eval_string("{DDMMYY}"));
lr_save_datetime("%d/%m/%Y", DATE_NOW, "DDMMYYYY");
lr_output_message("Today's Date is %s",lr_eval_string("{DDMMYYYY}"));
lr_save_datetime("%B %d %Y", DATE_NOW, "Today");
lr_output_message("Today is %s",lr_eval_string("{Today}"));
lr_save_datetime("%B %d %Y", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%A", DATE_NOW - ONE_DAY, "Yesterday");
lr_output_message("Yesterday was %s",lr_eval_string("{Yesterday}"));
lr_save_datetime("%A", DATE_NOW, "Today");
lr_output_message("Today is %s",lr_eval_string("{Today}"));
lr_save_datetime("%A", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%X", TIME_NOW , "Time");
lr_output_message("The time is %s (in this locale's date format)",lr_eval_string("{Time}"));
lr_save_datetime("%X", TIME_NOW + ONE_HOUR , "Time");
lr_output_message("In one hour it will be %s",lr_eval_string("{Time}"));
lr_save_datetime("%A", DATE_NOW + ONE_DAY, "Tomorrow");
lr_output_message("Tomorrow is %s",lr_eval_string("{Tomorrow}"));
lr_save_datetime("%j", DATE_NOW, "Today");
lr_output_message("Today is day %s in the year",lr_eval_string("{Today}"));
lr_save_datetime("%Z", DATE_NOW, "TimeZone");
lr_output_message("This machine is in the '%s' time zone",lr_eval_string("{TimeZone}"));
lr_save_datetime("%p", DATE_NOW, "AMPM");
if (strcmp (lr_eval_string("{AMPM}"),"PM")!=0)
{
lr_output_message("Good Morning");
}
else
lr_output_message("Good Afternoon");
Sunday, 21 September 2014
SCOM (System Center Operations Manager) Monitoring tool
System Center Operations Manager 2012 – the complete application monitoring solution
For many years Operations Manager has delivered infrastructure monitoring, providing a strong foundation on which we can build to deliver application performance monitoring. It is important to understand that in order to provide the application level performance monitoring, we must first have a solid infrastructure monitoring solution in place. After all, if an application is having a performance issue, we must first establish if the issue is due to an underlying platform problem, or within the application itself.
A key value that Operations Manager 2012 delivers is a solution that uses the same tools to monitor with visibility across infrastructure AND applications.
To deliver application performance monitoring, we provide 4 key capabilities in Operations Manager 2012:
Infrastructure monitoring – network, hardware and operating system
Server-side application monitoring – monitoring the actual code that is executed and delivered by the application
Client-side application monitoring – end-user experiences related to page load times, server and network latency, and client-side scripting exceptions
Synthetic transaction – pre-recorded testing paths through the application that highlight availability, response times, and unexpected responses
Configuring application performance monitoring
So it must be hard to configure all this right? Lots of things to know, application domain knowledge, settings, configurations? Rest assured, this is not the case! We make it incredibly easy to enable application performance monitoring!
1. Define the application to monitor.

2. Configure server-side monitoring to be enabled and set your performance thresholds

3. Configure client-side monitoring to be enabled and set your performance thresholds

And that’s it, you’re now set to go. Of course setting the threshold levels is the most important part of this, and that is the one thing we can’t do for you… you know your application and what the acceptable performance level is.
Configuring an application performance dashboard in 4 steps
It’s great that we make the configuration of application performance monitoring so easy, but making that information available in a concise, impactful manner is just as important.
We have worked hard to make the creation of dashboards incredibly easy, with a wizard driven experience. You can create an application level dashboard in just 4 steps:
1. Choose where to store the dashboard

2. Choose your layout structure. There are many different layouts available.

3. Specify which information you want to be part of your dashboard.

4. Choose who has access to the dashboard. As you will see a little later in this article, publishing information through web and SharePoint portals is very easy.

And just like that, you’ve created and published an application performance monitoring dashboard!
Anyone who has either worked in IT, or been the owner of an application knows the conversations and finger pointing that can go on when users complain about poor performance. Is it the hardware, the platform, a code issue or a network problem?
This is where the complete solution from Operations Manager 2012 really provides an incredible solution. It’s great that an application and associated resources are highly available, but availability does not equal performance. Indeed, an application can be highly available (the ‘5 nines’) but performing below required performance thresholds.
The diagram below shows an application dashboard that I created using the 4 steps above for a sample application. You can see that the application is available and ‘green’ across the board. But the end users are having performance issues. This is highlighted by the client side alerts about performance.

Deep Insight into application performance
Once you know that there is an issue, Operations Manager 2012 provides the ability to drill into the alert down to the code level to see exactly what is going on and where the issue is.

Reporting and trending analysis
An important aspect of application performance monitoring is to be able to see how your applications are performing over time, and to be able to quickly gain visibility into common issues and problematic components of the application.
In the report shown below, you can see that we can quickly see areas of the application we need to focus on, and also understand how these components are related to other parts of the application, and may be causing flow-on effects.


Easily make information available
With Operations Manager 2012, we have made it very easy to delegate and publish information across multiple content access solutions. Operations staff have access to the Operations Manager console, and we can now easily publish delegated information to the Silverlight based Operations web console and also to SharePoint webparts.
For many years Operations Manager has delivered infrastructure monitoring, providing a strong foundation on which we can build to deliver application performance monitoring. It is important to understand that in order to provide the application level performance monitoring, we must first have a solid infrastructure monitoring solution in place. After all, if an application is having a performance issue, we must first establish if the issue is due to an underlying platform problem, or within the application itself.
A key value that Operations Manager 2012 delivers is a solution that uses the same tools to monitor with visibility across infrastructure AND applications.
To deliver application performance monitoring, we provide 4 key capabilities in Operations Manager 2012:
Infrastructure monitoring – network, hardware and operating system
Server-side application monitoring – monitoring the actual code that is executed and delivered by the application
Client-side application monitoring – end-user experiences related to page load times, server and network latency, and client-side scripting exceptions
Synthetic transaction – pre-recorded testing paths through the application that highlight availability, response times, and unexpected responses
Configuring application performance monitoring
So it must be hard to configure all this right? Lots of things to know, application domain knowledge, settings, configurations? Rest assured, this is not the case! We make it incredibly easy to enable application performance monitoring!
1. Define the application to monitor.
2. Configure server-side monitoring to be enabled and set your performance thresholds
3. Configure client-side monitoring to be enabled and set your performance thresholds
And that’s it, you’re now set to go. Of course setting the threshold levels is the most important part of this, and that is the one thing we can’t do for you… you know your application and what the acceptable performance level is.
Configuring an application performance dashboard in 4 steps
It’s great that we make the configuration of application performance monitoring so easy, but making that information available in a concise, impactful manner is just as important.
We have worked hard to make the creation of dashboards incredibly easy, with a wizard driven experience. You can create an application level dashboard in just 4 steps:
1. Choose where to store the dashboard
2. Choose your layout structure. There are many different layouts available.
3. Specify which information you want to be part of your dashboard.
4. Choose who has access to the dashboard. As you will see a little later in this article, publishing information through web and SharePoint portals is very easy.
And just like that, you’ve created and published an application performance monitoring dashboard!
Anyone who has either worked in IT, or been the owner of an application knows the conversations and finger pointing that can go on when users complain about poor performance. Is it the hardware, the platform, a code issue or a network problem?
This is where the complete solution from Operations Manager 2012 really provides an incredible solution. It’s great that an application and associated resources are highly available, but availability does not equal performance. Indeed, an application can be highly available (the ‘5 nines’) but performing below required performance thresholds.
The diagram below shows an application dashboard that I created using the 4 steps above for a sample application. You can see that the application is available and ‘green’ across the board. But the end users are having performance issues. This is highlighted by the client side alerts about performance.
Deep Insight into application performance
Once you know that there is an issue, Operations Manager 2012 provides the ability to drill into the alert down to the code level to see exactly what is going on and where the issue is.
Reporting and trending analysis
An important aspect of application performance monitoring is to be able to see how your applications are performing over time, and to be able to quickly gain visibility into common issues and problematic components of the application.
In the report shown below, you can see that we can quickly see areas of the application we need to focus on, and also understand how these components are related to other parts of the application, and may be causing flow-on effects.
Easily make information available
With Operations Manager 2012, we have made it very easy to delegate and publish information across multiple content access solutions. Operations staff have access to the Operations Manager console, and we can now easily publish delegated information to the Silverlight based Operations web console and also to SharePoint webparts.
Subscribe to:
Posts (Atom)