In this tutorial, you will learn the basics of BeanShell scripting used with JMeter scripts.
Below are the topics which are covered as part of this session:
- BeanShell Scripting Basics
- Using commonly used methods
- Setting variables and using in Jmeter scripts
BeanShell scripting works on the principle of Java but it is very lightweight in comparison. Different handlers can be used like vars, log, ctx, prev, props and many more. Scripting can be used in both BeanShell sampler as well as BeanShell preprocessor.
Variables can be defined and assigned values via BeanShell script. Dynamic data like userIDs can also be generated via scripting if CSVDataSetConfig need not be to be used. There are many basis functions used in the scripting e.g. getThreadNum() which can return you the current threadnumber