Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter BeanShell - integer to string

Just trying to convert an integer to a string.

vars.put("test", i);

I'd like to put the value in the variable "test", but it does not working and I think I must convert the int to a string. But I have no idea how to do that. I just found a out how to parsing string to integer in BeanShellSampler.

like image 435
Paili Avatar asked Dec 09 '22 00:12

Paili


1 Answers

Use String.valueOf() method

vars.put("test", String.valueOf(i));

Additional information on Beanshell scripting in JMeter - How to Use BeanShell: JMeter's Favorite Built-in Component

like image 57
Dmitri T Avatar answered Jan 16 '23 04:01

Dmitri T