I am new to jmeter. I am trying to setup JMS point-to-point load test script. The request message is a fixed-length format. I need a way to read fields from csv and arrange them in fixed-length format. I tried using javascript slice function by using csv data config variables and slicing to required length, concating them all in one line. But it is not working. May be my approach is wrong. Any pointers on how to make it work with fixed length format will help. This is what I tried:
${__javascript((" ".slice(-6))+(("0000000000000000"+${Var2}).slice(-16)) + ((" " + ${Var3}).slice(-19))+((" "+${Var4}).slice(-3))}
where Var1,Var2..Var4 are from csv.
Jmeter version:3.3
MQ: IBM Websphere MQ
With a single input message I am able to execute the test. I need to dynamically populate values from csv and/or date/time functions and arrange them in fixed-length format.
__javaScript
(mind the capital S
And last but not the least, in order to get the most performance I would recommend using __substring() function instead of your slice()
function. You can install __substring()
and other Custom JMeter Functions using JMeter Plugins Manager