首页 > 解决方案 > aritmetic operation of csv data config value in jmeter

问题描述

I use jmeter data set config to read data from csv file. But I want to convert int to these values. For example in csv data set config there are 1,2,3,4,5. I use as ${variable}+1 or 2*${variable}%10

标签: jmeterjmeter-5.0

解决方案


You can add a JSR223 PreProcessor before the HTTP Request and do some operations there to modify the values:

int newValue = vars.get("variable").toInteger() + 1; OR
int newValue = ${variable} + 1; AND THEN
vars.put("variable", newValue);

推荐阅读