Blog
Categories
- Agile
- Best Practices
- Center of Excellence
- Cloud
- Featured
- Functional Testing and Automation
- Giveaway
- Healthcare IT
- HP
- HP Discover Conference
- HP Software Patches
- Latest News
- LoadRunner
- Methodology
- Mobile
- Northway Navigator Club News
- Operating Systems
- Performance Testing and Automation
- Quality Assurance
- Security
- Service Virtualization
- SiteScope
- Training
- TweakLR
- Uncategorized
- VuGen Code
Archives
- April 2019
- September 2018
- July 2018
- June 2018
- October 2017
- August 2016
- April 2015
- February 2015
- September 2014
- August 2014
- May 2014
- April 2014
- March 2014
- October 2013
- September 2013
- August 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- February 2011
- July 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- September 2007
- August 2007
- July 2007
- October 2006
- April 2006
- March 2005
- October 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- April 2003
-
VuGen: More Random Selections
Posted on October 14, 2009 by Admin
/*
The following lines will capture a list returned from a web server page response and
then randomly select one of the items from that list and pass it on
to the next URL
*/int rNum;
char x[500];web_reg_save_param(“temp_cat”,
“LB=abcdef”,
“RB=xyz”,
“Ord=ALL”,
LAST);web_url(“index.jsp”,
“Some URL’s”,
LAST);//srand is called before rand
srand(time(NULL));
rNum= rand() % atoi(lr_eval_string(“{temp_cat_count}”)) + 1;
lr_output_message (“A number between 1 and temp_cat_count: %d\n”, rNum);
/* rNum will be some rando Read Entire Entry
-
VuGen: Dynamic Transactions Created From A Parameter File
Posted on August 28, 2009 by Admin
From Michael Hendershot
Based on the search item I choose, I want a different transaction. This pulls the transaction name from parameter file and generates the transaction name off the “SearchFieldTransaction” column in my parameter file. Be careful. Tree view will take the “tmptransactionname” out of the lr_start and lr_end transaction.
Code:
Action()
{
char tmptransactionname[25];sprintf(tmptransactionname,”%s”,lr_eval_string(“{SearchFieldTransaction}”));
lr_start_transaction(tmpt Read Entire Entry
-
LoadRunner VuGen: Make any SERVER or URL a Parameter
Posted on July 30, 2009 by Admin
From Michael Hendershot:
// DEFINE VARIABLES
char *appurl; // Variable To Hold URL Name// ************************************************************************
// START – SELECT ENVIRONMENT TO RUN LOADTEST AGAINST BY UNCOMMENTING THE CORRECT ENVIRONMENT
// ************************************************************************//appurl = “server_url:9999”; // Application #1
appurl = “server_url:1111″; // Application #2// CONVERT URL TO PARAMETER TO USE IN URLS BELOW
lr_save_string(appurl,”p_Url”); Read Entire Entry -
LoadRunner VuGen: Determine if an iteger is odd or even
Posted on June 22, 2009 by Admin
Today’s code comes to us from Anthony Lyski:
“I ran into an issue today where I needed to know id an integer was an odd or even number. I found that this is a very effective way to determine. I put this code in a ‘for’ loop so you can see how it works over a range of numbers.”
int i;for (i=0;i<100;i++) {
if (i & 1){
lr_message(“%d is odd”, i);
}
else{
lr_message(“%d is even”, i);
}
} Read Entire Entry -
Programmatically Create A Unique Parameter Name
Posted on June 11, 2009 by Admin
Lets say you need to grab a list of items or numbers from a web page, such as GUID’s. These are not dynamic numbers, but will be used in a script as parameters. Here is how I captured the data I wanted and created my own DAT file:
Figure out the format you want the DAT file to be in. For me, this was a GUID, another GUID, and a user ID. I created a file and put the top line in with the headers GUID1, GUID2, LOGIN and saved it to my C: drive in the root folder. I already knew the login so I had already set this up a a paramet Read Entire Entry
-
LoadRunner VuGen: What’s Up With SPRINTF?
Posted on May 27, 2009 by Admin
In my custom load testing class, we usually get into specific code examples that demonstrate how to do some tips and tricks in VUGen. One of the things I always like to bring up is the behavior or sprintf. This is a commonly used C function for string manipulation. Many a young LoadRunner lad has come across the dreaded memory violation error in their output log when using sprintf:
Error: C interpreter run time error: Action.c (10): Error — memory violation : Exception ACCESS_VIOLATION received.
Let’s look at why. Here is some code: Read Entire Entry -
LoadRunner VuGen: Fixing Corrupted Winsock Libraries
Posted on May 25, 2009 by Admin
I was trying out the new Protocol Advisor in LoadRunner 9.5 this week, and I found it was not working as advertised. It wasn’t even recommending WEB as a protocol choice for recording a simple web script. Not good. The only thing it did recommend to me properly was RDP. If a person cannot figure out they are using RDP when they launch an RDP window, they probably should not be using LoadRunner. 🙂 I decided to dig a bit deeper and found I had discovered a bigger problem.
On my past several engagements, I had been using the client Read Entire Entry
-
VuGen: Dynamic data in web_submit_data
Posted on May 5, 2009 by Admin
This was developed as a result of load testing a bridal registry site written with BlueMartini. There needed to be a way for the Vuser to clean up its bridal registry at the end of each iteration. However, I couldn’t be assured of a specific number of items (because the item catalog changed frequently, and we varied the number of items added).
The web_submit_data function looks for a symbolic “LAST” to determine when it has reached the end of a variable argument list. This was modified by inserting it into a predefined argumen Read Entire Entry
-
VuGen Custom Function: xstrcat
Posted on April 23, 2009 by Admin
// – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
// Brian Wilson – TechSouth, LLC
// – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –// – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
// xstrcat()
// more efficient version of strcat
// – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
char *xstrcat( char *dest, char *src )
{
while (*dest) dest++;
while (*dest++ = *src++);
return –dest;
}
/*char * xstrcat(char * dest, const char * src) // alternate version Read Entire Entry -
VuGen: Replace Special Characters
Posted on April 14, 2009 by Admin
This function (called EncodeText) may be a bit out of date, but can be used to replace special characters and use different encoding. You could put this in the very top of the vuser_init section of your script, or in the globals.h or other include file.
//——begin code—————
EncodeText(New,Orig)
char *New;
char *Orig;
{
int New_index;
int Orig_index;
int len;len = strlen(Orig);
New_index = 0;
for (Orig_index=0;Orig_index<len;Orig_index++) {
Read Entire Entry -