Jul 10, 2007

JMeter: BeanShell Usage

With JMeter, sometimes we need run to later samplers based on response from previous samplers to provide scripts' flexibilities.

Normally "Regular Expression Extractor" could get expected value from sampler response;

Otherwise we might need to use __BeanShell(), __javaScript() (examples) with the help of JMeter's "Options | Function Help Dialog";

For more complex cases, we might have to use "BeanShell Assertion"; How to debug it? Refer to BeanShell Manual and try it in BeanShell Desktop window before copy it to your "BeanShell Assertion". Where to start BeanShell Desktop? Download it from http://www.beanshell.org/download.html and save it to your jmeter_home/lib, just double-click bsh*.jar and play. Enjoy it:)

No comments: