Latest Entries »


Use the below functions in Vugen to overcome this error.

 

web_set_sockets_option(“MAX_CONNECTIONS_PER_HOST”,”10″);
web_set_sockets_option(“MAX_TOTAL_CONNECTIONS”,”10″);

 

Advertisements

Use the below functions in Vugen script to overcome this error.

web_set_sockets_option (“CLOSE_KEEPALIVE_CONNECTIONS”, “1”);
web_set_sockets_option(“MAX_CONNECTIONS_PER_HOST”,”1″);
web_set_sockets_option(“OVERLAPPED_SEND”, “0”);
web_set_sockets_option(“IGNORE_PREMATURE_SHUTDOWN”, “1”);
web_enable_keep_alive();


char *date=”27 mar 2010″;
char *position;
int offset;
char *search_str[20] = {“jan”,”feb”,”mar”,”apr”,”may”,”jun”};
char *search_strvalue[20] = {“01″,”02″,”03″,”04″,”05″,”06″};
char * tokens;
char reqValue[100];
int i,j;

vuser_init()
{
lr_save_string(lr_eval_string(date),”date_new”);
lr_output_message(“%s”,lr_eval_string(“New date is {date_new}”));

j=0;
do
{
position = (char *)strstr(date, search_str[j]);
offset = (int)(position – date + 1);
j++;
} while (offset != 4);

tokens=(char *)strtok(lr_eval_string(“{date_new}”),” “);
i=0;
while (tokens!=NULL)
{
if(strcmp(tokens,search_str[j-1])==0)
{
strcat(reqValue, ” “);
strcat(reqValue, search_strvalue[j-1]);
strcat(reqValue, ” “);
}
else
{
strcat(reqValue,tokens);
}
tokens = (char *)strtok(NULL,” “);
}
lr_save_string(lr_eval_string(reqValue), “NewFormatDate”);

return 0;
}


C:\Program Files\HP\LoadRunner\bin>mmdrv.exe -usr DateFormatChange\DateFormatChange.usr

scripts should be placed inside the bin folder..


Put this code inside the action:-

char filename[1024], command[1024];
char new_dir[] = “C:\\Sample”;

/* Create a directory under root called xyz and make it the current dir */
if (mkdir(new_dir))
lr_output_message(“Create directory %s failed”, new_dir);
else
lr_output_message(“Created new directory %s”, new_dir);

sprintf (filename, “%s\\%s”, new_dir, “SIVA.txt”);

/* Execute a dir /b command and direct it to a new file */
sprintf (command, “dir /b c:\\ > %s /w”, filename );
system(command);
lr_output_message(“Created new file %s”, filename);

return 0;


typeperf -c “\Process(*)\% Processor Time” -si 00:01 -sc 50 -f CSV -o output.csv
typeperf -q -o output1.txt


Below is the snippet to be used for performance testing the SMTP server with bulk email messages or per your project needs,

 

Action()
{
// connect to smtp mail server
smtp_logon(“Logon”,
“URL=smtp://{P_userID}@mail.o365am.xxx.com:xxxx”,
“CommonName=SMTP {P_userID}”,
“LogonUser={P_LoginEmailID}”,
lr_decrypt(“5d564d6e185f6c5457b32fc024bc4a91aaacc3c”),
“STARTTLS=STARTTLS”,
LAST );

// send email
smtp_send_mail(“SendMail”,
“To={P_RecepientEmail}”,
“Cc={P_RecepientEmail}”,
“Bcc={P_RecepientEmail}”,
“From={P_LoginEmailID}”,
“Subject=Testing SMTP message from Load Runner”,
“ContentType=text/plain;”,
“charset=UTF-8”,
//     MAILOPTIONS,
//     “X-Priority: 3”,
//     “X-MSMail-Priority: Normal”,
//     “X-Mailer: Microsoft Outlook Express 5.00.2919.6700”,
//     “X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700”,
MAILDATA,
“MessageText=This is a simple mail from LR\r\n”,
LAST );

// wait time
lr_think_time(2);

// disconnect from server
smtp_logout();

return 0;
}


By using the below command, we can remote login to machine even though a session is already opened.

mstsc /v:{server name} /admin


Sometimes there might be a requirement to keep some files in the LG machine for temporary use. Have the file included in the script which needs to be copied to LG machine. Use the below mentioned commands to create a temporary folder inside c:\temp folder and copy the file from script folder to newly created folder in LG machine. Once the use of file is completed, use the last command to delete the newly created folder. Char command1[]=”mkdir \”c:\\temp\\\ext_jar”;

Char command2[]=”xcopy /Y filename.pdf \”c:\\temp\\\ext_jar\””;

Char command3[]=”RD /S /Q \”c:\\temp\\\ext_jar\””;

System(command1);

System(command2);

Lr_think_time(5);

System(command3);


Issue: “communication between vugen and the truclient browser could not be established”. This error occurs when we click the ‘Develop Script’ button.

Solution: Simple step, Run the Vugen.exe as ‘Administrator’.