Is it possible to loop through a array and select a character from the passwd using the ord[i] value? Code
String ordinal = vars.get("ordinal");
String[] ord = ordinal.split(",");
log.info(ord[0]);
String passwd = vars.get("password");
requiredOrd = new ArrayList();
for(int i=0; i< ord.length; i++)
{
requiredOrd.add((passwd.charAt(ord[i])));
}
log.info(requiredOrd[0]);
Returns error message as follows:
2017-10-23 10:23:26,270 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: String ordinal = vars.get("ordinal"); String[] ord = ordinal.split(","); log.inf . . . '' : Error in method invocation: Method charAt( java.lang.String ) not found in class'java.lang.String'
2017-10-23 10:23:26,270 WARN o.a.j.e.BeanShellPostProcessor: Problem in BeanShell script: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of:String ordinal = vars.get("ordinal"); String[] ord = ordinal.split(","); log.inf . . . '' : Error in method invocation: Method charAt( java.lang.String ) not found in class'java.lang.String'
