1. Problem: shutting down the server connection prematurely
In the LoadRunner test result, you may have seen the issue related to shutting down the server connection prematurely. If this error is identified many times in the test then it may lead to the failure of the test. Let’s investigate why this error comes and how to solve?
Error Statement:
Server XXX has shut down the connection prematurely
where XXX represents Server Name or IP address
Reason:
The specified server closes the established connection. This is because the server does not get the response from the client (LoadRunner) in the defined time-out limit and closes the connection. Hence LoadRunner throws this error message.
-> The Reason is the client is not able to read data from the server's socket in the specified timeout limit.
-> The error is because of slow client(LG) which was not able to read the data from servers's socket.
-> This could be because you have overloaded your LG Machine then it's capacity or the shared band width is too less for the vusers.
-> Try to understanding the load to multiple LG Machines to resolve the issue.
Possible Causes:
- The sharp ramp-up of the VUsers i.e. starting too many Vusers in short ramp-up.
- Too many Vuser’s on a single Load Generator.
- Access Vusers are held-up at Rendevous point.
Troubleshooting:
Increase the ramp-up time of Vusers
Limit the user count at Rendevous point using Rendevous Policy.
Use the appropriate number of Load Generator (LG Calculator)
Proper distribution of the load on each Load Generator.
Add below function at the beginning of the VuGen script:
web_set_sockets_option(“IGNORE_PREMATURE_SHUTDOWN”, “1”);
If the above function does not work then add another function:
web_set_sockets_option(“MAX_CONNECTIONS_PER_HOST”,”1″);
This function should be added at the very beginning of the script. This function forces a single connection to the server thus eliminating the possibility of shutting down an existing connection prematurely. Also, it eliminates the causes of error when LoadRunner sends data using that connection.
Clear the “Temp” folder of Load Generator and Controller.
How to resolve the “Server xxx has shut down the connection prematurely” error:-
As stated above, the error is because of slow client (LG) which was not able to read the data from server’s socket. This could be because you have over loaded your load generator machine then it’s capacity or the shared bandwidth is too less for the Vusers.
Try distributing the load to multiple load generator machines to resolve the issue.
==================================================
2. Problem : memory violation
Error Statement:
C interpreter run time error: Action.c (<script line number>) : Error — memory violation : Exception ACCESS_VIOLATION received
Reason:
While running the script, when a load generator tries to access a piece of memory that either doesn’t exist or access memory in the wrong way, then LoadRunner throws this error.
Possible Causes:
- Unclosed file in file handling logic
- Attempt to write a string literal
- Access memory allocated via web_set_max_html_param_len() function
- Using “Run as a Process” thread execution mode
Troubleshooting:
Use fclose() to close the open files
In Vuser scripts, string literals are read-only. Any attempt to write to a string literal generates an access violation, so avoid this situation.
Set ‘web_set_max_html_param_len(xxxxx);’ appropriately. If it has large number to capture the maximum data using web_reg_save_param() then try to calculate the max length of the strings per page and add around 30% to it.
Use “Run as a Thread” mode until and unless “Run as a Process” is not required.
3. SSL protocol error when attempting to connect with host" in vugen
Error Statement: Error -27778: SSL protocol error when attempting to connect with host
Troubleshooting :
SSL Protocol error means while running the scripts in controller the "Error -27778: SSL protocol error when attempting to connect with host",so finally by using the below steps in the script i have resolved the issue
Keep the below code at the start of of script
web_set_sockets_option("SSL_VERSION", "TLS");
web_set_sockets_option("SSL_VERSION", "1");
This forces the SSL connection to the server to use version 1 of the SSL protocol rather than letting the server suggest a version during the connection handshake.
====================
Error -26547: Authentication required, please use "web_set_user"
//Adding Correlation for jsessionID
web_reg_save_param("UserSessionID", "LB=PARAM NAME =\"sessionid\" VALUE = ", "RB=>","Ord=1", "IgnoreRedirections=Yes", "Search=Body", "RelFrameId=1", LAST);
//Adding Correlation for timer
web_reg_save_param("Timer", "LB=PARAM NAME =\"createtime\" VALUE = ", "RB=>", "Ord=1", "IgnoreRedirections=Yes", "Search=Body", "RelFrameId=1", LAST);
2.
Use web_add_cookie in the script and pass the cookie with the correct value if the application needs the cookie information.
(or)
use web_cache_cleanup() and web_cleanup_cookies() to clear the cookies. Altenatively use Run Time Settings -> Browser Emulation-> Simulate a new user on each iteration and Clear cache on each iteration.
=============
Error while decrypt the password in Script
I am getting the error when trying to encrypt the password.
web_submit_form("j_spring_security_check;jsessionid=2B9A700536CF3.nomurastructure-uat1",
"Snapshot=t2.inf",
ITEMDATA,
"Name=j_username", "Value=sar", ENDITEM,
//"Name=j_password", "Value=raj12", ENDITEM,
..............
web_submit_form("j_spring_security_check;jsessionid=2B9A700536CF3.nomurastructure-uat1",
"Snapshot=t2.inf",
ITEMDATA,
"Name=j_username", "Value=sar", ENDITEM,
"Name=j_password", "Value=lr_decrypt("4eef27caaa2a43b49d52")", ENDITEM,
But it gives compile error.
Ans : To do this right you need to change the code to:
lr_save_string( lr_decrypt("4eef27caaa2a43b49d52") ,"passwd"); // Store Password in a variable
web_submit_form("j_spring_security_check;jsessionid=2B9A700536CF3.nomurastructure-uat1",
"Snapshot=t2.inf",
ITEMDATA,
"Name=j_username", "Value=sar", ENDITEM,
"Name=j_password", "Value={passwd}", ENDITEM, // Use the parameter here !!
===========
ALNUM in correlation function.
Error Message : "Sub-argument number 1 of the "LB" argument (number 2) is invalid" for correlation function - I am trying to handle dymanic boundary in LB. Please let me know if any other info required.
web_reg_save_param("JSession_Id",
"LB/ALNUM=JSESSIONID^^=",
"RB=_SAP",
LAST);
Ans :- The syntax of function is: web_reg_save_param("TestCorrValue", "LB=", "RB=", LAST);
So you need to find the LB and RB of the correlation value.
If your LB is '/ALNUM=JSESSIONID^^' and RB is '_SAP', so the syntax is:
web_reg_save_param("TestCorrValue", "LB=/ALNUM=JSESSIONID^^", "RB=_SAP', LAST);
Ex : "asxasda<123456>TaskTitle>P#1810 Line7072 DU:RECORDREPLAY"
There is no issue with the space after Line7072. As I mentioned, the correct syntax is "RB=abc" with 'abc' is the correct right boundary value.
In your first function, you are uisng 'RB/DIG=' which is not correct and in the second function, you are uisng the correct syntax 'RB=' and it returned the correct value.
Wrong one is :
web_reg_save_param("Test",
"LB=asxasda<",
"RB/DIG=>TaskTitle>P#1810 Line#### DU"
LAST);
the same below function does return the expected value.
Correct one is :
web_reg_save_param("Test",
"LB=asxasda<",
"RB=>TaskTitle>P#1810 Line"
LAST);
===============
How to convert a load runner variable to C integer
Ans :
web_reg_find("Text=Welcome","SaveCount=TextCount",LAST);
web_submit_data("login.pl",
"Action=http://.......",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://......",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
LAST);
if(atoi(lr_eval_string("{TextCount}"))>0)
{
lr_end_transaction("Login",LR_PASS);
}else{
lr_end_transaction("Login",LR_FAIL);
}
We used ‘if statement’ here with ‘SaveCount’ attribute. The ‘TextCount’ parameter that saves the number of occurrences of the text cannot be used directly in ‘if’ condition as it is a load runner string. So this parameter has to be converted into C string first and then to C integer. ‘lr_eval_string’ and ‘atoi’ functions are used (respectively) to take care of this.
The ‘atoi’ C function converts a C string into a C integer.
==================
How to send a random value in a request
Ans : strcpy(flightVal,lr_eval_string(lr_paramarr_random("cFlight")));
The input to ‘lr_paramarr_random’ function is a parameter array and the output is a random value from this array. So here the output of this function is one of the four flight values. And as this random value is an LR string, ‘lr_eval_string’ function is used (to convert the same into C string).
‘strcpy’ C function finally copies this value into a C string variable ‘flightVal’.
Now again we have to convert this C String variable into LR string to be able to send in the request.
==========================
Qus : How to split a string into tokens
Ans :
The value 020;338;04/03/2018 say we have to use only ‘338’, then we need to split this string and store this into a variable.
To do this ‘strtok’ function is used.
’strtok’ C function returns a token from a string delimited by specified characters. After the first invocation, we have to pass ‘NULL’ as the value of the string to get the next token. The example below shows how this function is used to split the flight value based on the semicolon (;) delimiter.
Example :
Let’s assume that the flight value is captured from the relevant response into the parameter ‘cFlight’.
char string[100];
char *token;
int i=1;
strcpy(string,lr_eval_string("{cFlight}"));
token=(char *)strtok(string,";");
lr_output_message("Token %d is %s",i,token);
while(token != NULL) {
i=i+1;
token=(char *)strtok(NULL,";");
lr_output_message("Token %d is %s",i,token);
}
==========================
How to fix Decompression Errors :-
example : Error -26601: Decompression function (wgzMemDecompressBuffer) failed, return code=-5 (Z_BUF_ERROR), inSize=0, inUse=0, outUse=0.
Sol : Increase the Network Buffer size in Runtime Settings-> Preferences -> General
Issue : PC/Controller Error : The user files were not transferred to the local load generator
While running Vusers in the PC/ Controller the user receives the following errors:
Error: “82000 One or more of the script’s files have illegal names. It is possible that two files are using the same name and directory.”
Error: “84805 The user files were not transferred to the local load generator”
The scripts run fine on the local host but experience the above error while trying to run on a remote machine
Solution:
This errors occur when there is a mismatch of parameter data file path in loadrunner and in .prm file.
Ex: let us assume your parameter file as p_Username.dat in loadrunner script , but if you see in that .prm file the table name entry will be “Table=p_username.dat” so because of this your parameter file will not be loaded to your Load generator.
[parameter:PasswordParam]
Delimiter=”,”
ParamName=”PasswordParam”
TableLocation=”Local”
ColumnName=”PasswordParam”
Table=”p_username.dat”
GenerateNewVal=”EachIteration”
Type=”Table”
value_for_each_vuser=””
OriginalValue=”sample”
auto_allocate_block_size=”1″
SelectNextRow=”Same line as UserNameParam”
StartRow=”1″
OutOfRangePolicy=”ContinueWithLast”
[parameter:p_username]
Delimiter=”,”
ParamName=”FullNameParam”
TableLocation=”Local”
ColumnName=”FullNameParam”
Table=”p_username.dat”
GenerateNewVal=”EachIteration”
Type=”Table”
value_for_each_vuser=”1″
OriginalValue=””
auto_allocate_block_size=”1″
SelectNextRow=”Same line as UserNameParam”
StartRow=”1″
OutOfRangePolicy=”ContinueWithLast”
The Best solution is to check files before load test and use small case for the parameter file which will eliminate this issue.
1. Make sure that all the parameters referencing the same parameter file use the same case for the file name/file path when it is being added to the script. If the case for the parameter file name/file path differs, it might causes problems.
2.Make sure that the ScriptName.prm file references the parameter in the script in correct case. If not, it might cause problems.
3.Make sure that there are no spaces in the parameter file names. Embedded spaces will work for VuGen but not for Performance Center.
No comments:
Post a Comment