Pages

Monday, 30 January 2017

JMeter - Assertion - "BeanShell Assertion"

BeanShell Assertion is a scripting-based Assertion element. It means that you need to implement the assertion logic by yourself using one of the supported scripting languages. Usually, it is helpful when you need to define assertion or validation logic based on your requirement and want to write some unique algorithm which is not currently provided by JMeter. You can create your own implementation of the algorithm using BeanShell Assertion.
How to add "BeanShell Assertion" element?
You can follow below steps:
1. Select "Sampler" node whose response you want to validate.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "BeanShell Assertion"

How to remove "BeanShell Assertion" element?
You can follow the below steps:
1. Select "BeanShell Assertion" node
2. Right click on "BeanShell Assertion" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"    

What are the attributes of "BeanShell Assertion" element?

"BeanShell Assertion" has following attributes:
  • Name: To provide the name of the timer
  • Comments: To provide arbitrary comments (if any)
  • Reset bsh.Interpreter before each call: Interpreter will be recreated by selecting the value of this option as 'Yes'. 
  • Parameters: Parameters to pass to the BeanShell script. This is an optional attribute.  
  • Script file: A file containing the BeanShell script to run. The return value is used as an assertion output generated by BeanShell script.
  • Script: The BeanShell script which contains the assertion logic.
Next Topic:
Apache JMeter - Assertion - "JSR223 Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "XML Assertions" Element

Related Topics:


  

No comments:

Post a Comment