New answers tagged

2

vars is a shorthand for JMeterVariables and vars.get() function gives you a String So the options are in: Use the string as it is: String user_number = vars.get("USER_COUNT") Or convert it to an Integer: int user_number = vars.get("USER_COUNT") as int


2

Since vars.get("USER_COUNT") returns a String you cannot store that into a int variable that's the reason exception is thrown You should convert the string to int using below way int user_number = Integer.parseInt(vars.get("USER_COUNT")) log.info('Total use is '+user_number) Hope this will be helpful.


1

Your design is kind of violating JMeter Scoping Rules, if you have a HTTP Header Manager under a Test Fragment - it will be applied only to HTTP Request samplers which reside under that Test Fragment. So if you want the HTTP Header Manager to be applied to all HTTP Request samplers in your test plan - just put it under the Test Plan element (the same level ...


1

Add the next line to user.properties file: sample_variables=phone Restart JMeter to pick up the change Instead of ${phone} in the Flexible File Writer use variable#0 If you need to write more than one variable: sample_variables=phone,device_id and then in the Flexible File Writer: variable#0 - instead of ${phone} variable#1 - instead of ${device_id} ...


Top 50 recent answers are included