The last article Jmeter advanced Bean shell usage (1) briefly introduced the Bean shell in Jmeter, this article is a supplement to the above,
Mainly summarize several commonly used scenarios and methods, I believe these can basically cover most of the needs. The content of this section is as follows:
1. Operating variables
2. Operational attributes
Three, custom function
Four, reference external java files
Five, reference external class files
Six, reference external Jar package
Seven, other usage (accepting parameters, log, etc.)
1. Operating variables: By using the built-in object vars of the Bean shell, you can access variables
a) vars.get("name"): get the variable value from jmeter
b) vars.put("key", "value"): save the data to jmeter variables
2. Operational properties: through the use of Bean shell built-in object props