Author: sebb
Date: Tue Oct 7 08:38:25 2008
New Revision: 702520
URL: http://svn.apache.org/viewvc?rev=702520&view=rev
Log:
Can use SCRIPT variable to avoid need to quote commas
Modified:
jakarta/jmeter/trunk/xdocs/usermanual/functions.xml
Modified: jakarta/jmeter/trunk/xdocs/usermanual/functions.xml
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/functions.xml?rev=702520&r1=702519&r2=702520&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/functions.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/functions.xml Tue Oct 7 08:38:25 2008
@@ -189,8 +189,8 @@
configure them, and these go in parentheses, comma-delimited. If the function
takes no arguments, the parentheses can
be omitted.</p>
-<p>Argument values that themselves contain commas should be escaped as
necessary.
-If you need to include a comma in your parameter value, escape it like so:
'\,'.
+<p><b>Argument values that themselves contain commas should be escaped as
necessary.
+If you need to include a comma in your parameter value, escape it like so:
'\,'.</b>
This applies for example to the scripting functions - Javascript, Beanshell,
Jexl - where it is necessary to escape any commas
that may be needed in script method calls - e.g.
</p>
@@ -198,6 +198,14 @@
${__BeanShell(vars.put("name"\,"value"))}
</pre>
<p>
+Alternatively, you can define your script as a variable, e.g. on the Test Plan:
+<pre>SCRIPT vars.put("name","value")</pre>
+The script can then be referenced as follows:
+<pre>${__BeanShell(${SCRIPT})}</pre>
+There is no need to escape commas in the SCRIPT variable because the function
call is parsed before the variable is replaced with its value.
+This works well in conjunction with the BSF or BeanShell Samplers, as these
can be used to test Javascript, Jexl and BeanShell scripts.
+</p>
+<p>
Functions can reference variables and other functions, for example
<code>${__XPath(${__P(xpath.file),${XPATH})}</code>
will use the property "xpath.file" as the file name
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]