On 08/02/06, Mamading Ceesay <[EMAIL PROTECTED]> wrote: > Hi, > > Following up from my thread yesterday, I'm trying to use a BeanShell function > in a Http Request Sampler that POSTs a form. This function transforms the > contents of a variable called viewstate containing a string grabbed from the > form in a RegEx Extractor attached to the Http Request Sampler that did a GET > of the form. > > I've tried two versions of the function without success. A succint version > and a more verbose one. My Java is more than a little rusty, so I probably > made a newbie error somewhere. Here are the functions: > > 1st function was derived from print(java.net.URLEncoder.encode(viewstate, > "UTF-8")); > > ${__BeanShell(return java.net.URLEncoder.encode(vars.get("${viewstate}"), > "UTF-8"); )}
You need to quote commas in function calls - commas are used to delimit function parameters. See Section 9.3 in: http://jakarta.apache.org/jmeter/usermanual/functions.html Try: ${__BeanShell(return java.net.URLEncoder.encode(vars.get("${viewstate}")\,"UTF-8"); )} S. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]