Last active
December 26, 2016 17:17
-
-
Save vinsguru/ba9b33cb25b56e754a852baa3b1f72e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public String execute(SampleResult arg0, Sampler arg1) throws InvalidVariableException { | |
JMeterVariables vars = getVariables(); | |
String str1 = ((CompoundVariable) values[0]).execute().trim(); //parameter 1 | |
String str2 = ((CompoundVariable) values[1]).execute().trim(); //parameter 2 | |
String delimiter = ""; | |
if(values.length>2){ | |
delimiter = ((CompoundVariable) values[2]).execute(); //parameter 3 - delimiter could be a space - don't trim | |
} | |
String result = str1 + delimiter + str2; | |
//user might want the result in a variable | |
if( null!=vars && values.length>3){ | |
String userVariable = ((CompoundVariable) values[3]).execute().trim(); | |
vars.put(userVariable, result); //store the result in the user defined variable | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment