Tuesday, August 23, 2022

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 !!