Monday, August 29, 2022

Free LoadRunner download | Micro focus Load Runner free trail version download

Previous links were not working for free download of Vugen and Analysis tools. We can download the latest software trails from the below link. We now have a gated access to LRP community edition. You can sign up to get access using this link.

https://www.microfocus.com/en-us/products/loadrunner-professional/free-trial

When you finish, Micro Focus team will send you the download links. You will discover that the software has a community license built in when you download and install it. To verify this, launch the LR license utility. Please be aware that the community bundle license is only intended for use in the development of tests and the execution of proof-of-concept projects. All protocols—aside from COM/DCOM, templates, and GUI Virtual Users—are included in this community bundle. Commercial usage of the community package is expressly forbidden and it is given without any type of support or warranty.

Sunday, August 28, 2022

What is Wasted Time ? | LoadRunner Vugen Wasted Time

In order to distinguish between actual time spent on processing and displaying information and human/idle-waiting overhead, the idea of Wasted Time was established.. Wasted time is calculated as a factor of unnecessary waiting. Your script can also add wasted time with lr_wasted_time() function.

For Web http html script, the time taken for web_reg_find or web_reg_save_param functions to look for a particular string in the response buffers, is counted as wasted time. The transaction time includes the ''wasted time'' but it is subtracted from transaction time when displayed in Controller and Analysis.

The wasted time does not include the time spent writing the Vugen log file and the Vuser log files. The actual elapsed transaction time is increased by the logging time. The function lr get transaction duration() returns the real amount of transaction time that has passed. The analysis and creation of test scripts may benefit from this knowledge.

You can retrieve the total wasted time (both that generated automatically and that added with lr_wasted_time) with the function lr_get_transaction_wasted_time(), or with lr_get_trans_instance_wasted_time(), as appropriate.

Saturday, August 27, 2022

Write transaction responses to a text file in Vugen Load runner | Capture transaction response times load runner | Capture and display the response times from replay log vugen LoadRunner

If you want to write the transaction response time to a file in Vugen, you must use the function lr_get_transaction_duration(). The lr_get_transaction_duration function returns the duration in seconds of the specified transaction to this point. You use this function to determine the total transaction time before the transaction has ended. lr_get_transaction_duration returns values greater than zero only for open transactions. Here is the code to copy the transaction response time and display it to the replay log.

SAMPLECODE:
Action()
{

        double trans_time;
        int status;
    
        web_cleanup_cookies();       
        web_set_sockets_option("SSL_VERSION""TLS1.2");
        web_set_max_html_param_len("999999");
                             
        
        lr_start_transaction("Digital_HondaCity_01_HomePage");
            
     web_url("AirVistas"
        "URL=https://Airvistas/service/access/findseat/"
        "TargetFrame="
        "Resource=0"
        "RecContentType=text/html"
        "Referer="
        "Snapshot=t10096.inf"
        "Mode=HTML"
        LAST);  
     
          trans_time = lr_get_transaction_duration("Digital_HondaCity_01_HomePage");
          
          lr_end_transaction("Digital_HondaCity_01_HomePage",LR_AUTO);
        
                     
         if (trans_time)
         lr_output_message("The duration of DHC Home Page : %f seconds", trans_time);
         else
         lr_output_message("The duration cannot be determined.");
          return 0;
}

Here is the output:


If you want to copy this duration to a file ,Please follow the below link.

Friday, August 26, 2022

NL-NETWORK-01 error in NeoLoad

Error detected by NeoLoad

Error Code: NL-NETWORK-01
Message: Network error: An IO error occurred sending the request.
Details: java.net.SocketException: Network is unreachable: no further information     

This is an Miscellaneous I/O error when connecting to the server . When you see this error, immediately check the https URL that you are using for your request. It may be wrong URL or having some typos in it or may the server end the app is down. Once you correct it and replay it should work.

Thursday, August 25, 2022

NL-NETWORK-02 BindException errors in Neolaod | Neoload NL-NETWORK-02 error

When you are running a load test on NeoLoad sometimes you may see the NL-NETWORK-02 "BindException" errors, Typically, this occurs because the system's socket creation capacity has been reached by the load generator. Therefore, it is necessary to change the system TCP/IP settings. Windows computers frequently experience this since a lot of sockets cannot be generated by default.

Reboot the computer hosting the Load Generator after adding the following values to the \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters key using regedit.


MaxUserPort - 65534 -(REG_DWORD, decimal)
TcpTimedWaitDelay - 30 - (REG_DWORD, decimal)

How to add a cookie in Neoload | Web_add_Cookie in Neoload | How NeoLoad manage cookies?

NeoLoad automatically manages any cookies returned by the server during the load test. These cookies can also be defined when configuring the request settings. If you want to add a cookie manually then use the below code in JavaScript NeoLoad. That's it.

context.currentVU.setCookieForServer("Domain=www.easyloadrunner.blogspot.com","Environment=CityLS");

Wednesday, August 24, 2022

Generate current date or Timestamp in NeoLoad using JavaScript | NeoLoad date variable | Get Date/Time in UTC in JavaScript

If you want to generate current Timestamp in NeoLoad using JavaScript, you can simply write the below code and you can enhance more based on the result. you can add days or months or years.

//Declare the variables

var DateNTime = new Date();
var utcDate = DateNTime.toUTCString();
 
//Print results to NeoLoad log

logger.debug("UTC_Date="+utcDate);

// Inject the computed value in a runtime variable, this can be used as a parameter in the NeoLoad requests ex:${UTC_Date}

context.variableManager.setValue("UTC_Date",utcDate);

Tuesday, August 23, 2022

Get epoch timestamp in Neoload | epcoh time stamp java script with neoload

if you want to generate the epoch timestamp in Neoload, its so simple you just need to write 4 lines of java script and can pass the same variable to your requests.


var time = new Date()
var Timestamp = Math.round(time.getTime() / 1000)

logger.debug("time="+Timestamp);
context.variableManager.setValue("time",Timestamp);






How to delete unwanted files and results folders from LoadRunner scripts folders

When you are running load runner script for multiple iterations, it may pileup the logs and idx files in the script folder, which causes the more memory consumption for script folders. To get rid of this, we can execute a simple batch file . Copy all the below code and paste it in a notepad and name it as LRCleanUP.bat batch file. Then go to LR scripts folder and double click on it.

This batch file can be run either from within a script folder, or from a top-level folder containing multiple LoadRunner scripts. If run in a top level folder it loops through all sub-folders deleting files and results folders as it goes. It deletes unwanted log files and output files

IF EXIST %temp%blankfile.txt  del %temp%blankfile.txt /q
IF EXIST %temp%FilesDeleted.txt  del %temp%FilesDeleted.txt /q
IF EXIST %temp%FoldersDeleted.txt  del %temp%FoldersDeleted.txt /q
IF EXIST %temp%BadParms.txt  del %temp%BadParms.txt /qtype nul > %temp%blankfile.txt
type nul > %temp%FilesDeleted.txt
type nul > %temp%FoldersDeleted.txt
type nul > %temp%BadParms.txt
del *.idx /s >> %temp%FilesDeleted.txt
del mdrv*.log /s >> %temp%FilesDeleted.txt
del mdrv.txt /s >> %temp%FilesDeleted.txt
del options.txt /s >> %temp%FilesDeleted.txt
del *.ci /s >> %temp%FilesDeleted.txt
del combined_*.c /s >> %temp%FilesDeleted.txt
del output.txt /s >> %temp%FilesDeleted.txt
del debug.inf /s >> %temp%FilesDeleted.txt
del *.bak /s >> %temp%FilesDeleted.txt
for %%d in (h) do (
for /f “delims=” %%a in (‘dir/s/b/ad “%CD%result*”‘) do (
echo “deleted %%a” >> %temp%FoldersDeleted.txt
rd /s /q “%%a”
)
)
rd result1 /s /q
findstr /S “:\” *.prm > %temp%BadParms.txt
fc %temp%FilesDeleted.txt %temp%blankfile.txt > nul
if errorlevel 1 “Notepad.exe” “%temp%FilesDeleted.txt”
fc %temp%FoldersDeleted.txt %temp%blankfile.txt > nul
if errorlevel 1 “Notepad.exe” “%temp%FoldersDeleted.txt”
fc %temp%BadParameters.txt %temp%blankfile.txt > nul
if errorlevel 1 “Notepad.exe” “%temp%BadParms.txt”
IF EXIST %temp%blankfile.txt  del %temp%blankfile.txt /q
IF EXIST %temp%FilesDeleted.txt  del %temp%FilesDeleted.txt /q
IF EXIST %temp%BadParms.txt  del %temp%BadParms.txt /q

Monday, August 15, 2022

How to Record Desktop Applications Using Jmeter | Desktop application load test with Jmeter

Recently I got a requirement of load testing for a desktop stock market application. The desktop application recording is quite simple just you need some proxy settings. The proxy settings for desktop application is to set the proxy at system level in-spite of browser level. The recording is same as browser recording with JMeter. Following is the process for recording the Desktop application using Proxy. You need latest version of JMeter for this recording. Old versions were not supporting.
  • Open "Internet Options" from Control Panel.
  • Click on "Connections" Tab and Click on "LAN settings"
  • Go to Proxy Server tick the "Use proxy for your LAN"
  • Edit the localhost as address and 9091/9092 as port (Do not use 8080/8888 ports) then click OK
  • Disable or uncheck the Automatically detect settings




JMeter Proxy Settings:
  • Use this same Proxy setting in JMeter proxy Server and please keep in mind that do not open any other application that use the same network .
  • Start Proxy in JMeter and Open the desktop Application, and now record it. That's it

Happy Testing !!

Capture the count of parameters in a file Neoload | Loop the parameter count times in Neoload | Neoload java script container

If you want to capture the count of parameters in a parameter file and loop the number of parameter times in  NeoLoad just use the java script code as below and get it done.

//Declare a variable in a file.Adjust the path to your file variable as necessary.

var fileName = "C:\\Users\\NeoloadScripts\\Desktop\\Userid.txt";

Note: you can use any file here either txt or csv or any other text formats

//Read the File and get line count


var reader = new Packages.java.io.LineNumberReader(new Packages.java.io.FileReader(fileName));
while ((reader.readLine()) != null) {}
var lineCount = reader.getLineNumber();
reader.close();



If a file variable has a column header line, alter the value by deducting 1 from the value; otherwise, don't use.

var lineCount = lineCount-1

//Log value of line count from file

logger.debug("Line number is = "+lineCount);


//Return to the Neoload script a variable with the value of the line count.


context.variableManager.setValue("LoopCount",lineCount);


After this java script go to the go to the loop and in the settings-execute loop enter ${LoopCount} as shown in below.



Tuesday, August 9, 2022

Load runner to Neoload script converter with a command line tool | LR to Neoload Script Converter

A command-line utility called The Script Converter transforms LoadRunner scripts into NeoLoad projects.

Download the tool from here {Neotys Lab}:

Download Script Converter

Open Command Prompt and enter the following Command:

-source <LR Scripts folder> -target <NeoLoad output directory> -project <NeoLoad Project name

Example: 

Windows.\script-converter.bat -source "C:\LoadRunnerScripts\TestHome" -target "C:\Users\Documents\NeoLoadProjects\TestHome" -project "TestHome"

Linux/OSX./script-converter.sh -source "/home/user/LoadRunnerScripts/TestHome" -target "/home/user/NeoLoadProjects/TestHome" -project "TestHome"

LR Scripts folder - Source directory where all scripts in each sub-directory will be converted into the output Project
NeoLoad output directory - The folder of the created NeoLoad Project
NeoLoad Project name - The name to assign to the NeoLoad project

Saturday, August 6, 2022

How to convert LoadRunner script to NeoLoad project? | NeoLoad Script Converter

I have a Loadrunner script and I would like to convert it to a Neoload Project. There's an easy way to do this automatically.
1.First you need to open Neoload tool, then go to Tools and Script Converter 

2. You need to enter load runner script directory or folder(not the Vugen Script location) and give a name to your neoload project and give the directory path where the neoload converted script need to be stored as shown in below.


3.Click on next to initiate the conversion process

Once the the process is over, It will show you the successful message as highlighted in the below image.

You can see the converted neoload project loading

This is the final converted script with all Init, Action and end.

Note: (This converter utility is available in 6.2 or below version only. You can install both neoload 6.2 and 8 versions on the same machine if you need converter utility,but at a time you can open any single version as both of them using same port 8090)