jmeter
jmeter copied to clipboard
random function generate multiple value when access more than once
Hi I'm using jmeter 5.6.2 with iso8583 plugin.
try to use this groovy script but seems jmeter create two value for field 11 that use random function ${__Random(111111111111,999999999999,)}!
seems random function generate multiple value when access more than once!
if (!vars.getObject('addMac')) {
def macKey = new javax.crypto.spec.SecretKeySpec(
org.jpos.iso.ISOUtil.hex2byte('1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A'), 'ISO9797ALG3')
def ssm = new nz.co.breakpoint.jmeter.iso8583.SecurityModule()
vars.putObject('addMac', { sampler ->
def msg = sampler.getRequest()
def p = msg.getPackager()
def bytes = [0,2,11,12,47].collect {
p.getFieldPackager(it).pack(msg.getComponent(it))
}.flatten() as byte[]
sampler.addField('64', ssm.generateMAC(bytes, macKey, macKey.getAlgorithm()))
})
}
vars.getObject('addMac').call(sampler)
FYI: main issue report here and developer of this plugin told me this issue related to jmeter 5.6.2!
Would you please fix this issue? Any idea? Thanks