Monday 15 August 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.