Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. In JMeter and BeanShell, how can I make a variable lowercase?
  2. my_lowercase_variable
  3.        
  4. ${__BeanShell('${my_variable}'.toLowerCase())}  //fails
  5.        
  6. ${__javaScript('${my_variable}'.toLowerCase())}  //fails
  7.        
  8. Response code: 500
  9. Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval  Sourced file: inline evaluation of: ``String blah = AAP;  vars.put("blah", blah.toLowerCase());  //${blah} now availab . . . '' : Typed variable declaration : Void initializer
  10.        
  11. String blah = "${my_initial_reference}";
  12. vars.put("blah", blah.toLowerCase());  //${blah} now available
  13.        
  14. Name: my_initial_reference
  15. Value: ITS IN CAPS
  16.        
  17. String blah = "${my_initial_reference}"; //
  18. vars.put("blah", blah.toLowerCase());  //${blah} = "its in caps" now available