hello!
I have the following problem in Jmeter:
I want to add a code to my BeanShell Tester that generates a 44-character barcode. But so far, without success.
So I went to plan "B":
I added a Random Variable with 44 characters, but it doesn’t get created. It does not display any errors.
Could someone help me and tell me what I can do to make it work?
Below are the variables:
Output format: 0000000000000000000000000000000000000000
Minimum value: 1000000000000000000000000000000000000000
Maximum value: 9999999999999999999999999999999999999999
As for the code, I didn’t share it here, but if anyone knows and has a code that generates barcodes, I’d appreciate it!
Anyway, that’s it folks!
Thank you very much in advance!
>Solution :
If you’re doing Beanshell scripting (however since JMeter 3.1 you should be using Groovy) the better option would be doing something like:
vars.put("CodeBarra", org.apache.commons.lang3.RandomStringUtils.randomNumeric(44));
Alternatively you can use it in __groovy() function:
${__groovy(org.apache.commons.lang3.RandomStringUtils.randomNumeric(44),CodeBarra)}

