Published On Jul 30, 2019
This is the twentieth video of JMeter Tutorial series which covers Introduction to BeanShell script and its variables
Learning:
What is BeanShell?
• scripting language developed in java
• it can dynamically execute standard java syntax
• scripting features- loose type (variables are declared without any type) , commands etc
Why BeanShell scripting required in JMeter?
Many a times, you might need additional scripting to customize the script in your own way, even though general functionalities of JMeter cover many needs of a performance test. In such cases Beanshell scripting comes into picture.
In JMeter, BeanShell script can be executed with the help of:
• BeanShell sampler
• BeanShell pre processor
• BeanShell post porocessor
BeanShell sampler – it has provided predefined list of variables which we can use in our script
vars.put("link", "www.google.com"); - to set the value of a variable
var x =vars.get("link"); - to get the value of a variable
log.info("value of x is "+ x); - to print inside the logs
ctx.getThread().getThreadName(); - to get thread name
Write data to CSV file using BeanShell Script - • JMeter tutorial 21 - BeanShell Script...
==================================================================
Git and GitHub Tutorial Playlist:
• Git and GitHub Tutorial
Automation Anywhere Tutorial Playlist:
• Automation Anywhere A11 Tutorial
Subscribe for more tutorials - / @qualityassurancelab7764