Posts

Showing posts from June, 2020

Jmeter Preprocessor to add Dynamic parameters

Image
sub: one scenario need to capture the data from previous request and pass as a parameters in jmeter Problem: but key and pair both are dynamic and very huge values. we can't handle each parameter as below Note: Here Key and values both are dynamic Solution : we need to capture all the respose data and segrigate and pass through JSR223Preprocessor. Here is the solution. Step1: Step 2: Modify the request Add JSR223Preprocessor in the request //int count=Integer.parseInt(vars.get(“paths_matchNr”)) //log.info “parameters count” + count //vars.put("JsonResponse", prev.getResponseDataAsString()); import java.util.regex.Matcher; import java.util.regex.Pattern; import java.text.*; import java.util.*; //Paths Data List result= new ArrayList(); def count = Integer.parseInt(vars.get("ALLVALUES_matchNr")); log.info("count=" + count);//83 //["#31:218","#62:1","#61:1","#63:1","#31:2...