Category: Testing Tools



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;
}


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’.

IP Spoofing in Loadrunner


IP Spoofing

It is a technique used for creating Internet Protocol (IP) packets with a forged source IP address, with the purpose of hiding the identity of the sender address.

IP Spoofing in Loadrunner

This technique is used in Loadrunner Agent machines, in order to make the Application server to think requests are coming from different machines. This purposely used in the Load Balancing Application servers which runs on the IP based distribution.

Procedures to configure the IP Spoofing in Loadrunner

Step 01: Get the required number of static IPs (based on number of vusers to be executed) from the Network Administrator, which should have the same ‘Default gateway’ of the LG machine.

Step 02: Follow the IP wizard in the LG machine and do the setup by adding the required number of Static IPs.

Step 03: After finishing the configuration setup, try pinging one of the static IP. It should not get ‘Timed Out’ error.

Step 04: Now we are ready to do the execution with Controller. While creating the scenario, enable the ‘IP Spoofing’ option in the LG machine.

This should work. If any issues, comment to reach me. Thanks.


Inorder to start scripting the SAP applications using the Loadrunner tool, we have to enable the scripting mode available in the SAP application apart from the normal script enabling setting.

Please use the TCode – RZ11

Navigate to the page it allows and change the settings to ‘FALSE’ for the below mentioned parameters.

a. sapgui/user_scripting_set_readonly and set the value as “FALSE”
b. sapgui/user_scripting_force_notification and set the value as “FALSE”

TY