Pages

Monday, 30 January 2017

JMeter - Listener - "JSR223 Listener"


The content has been moved to PerfMatrix site.

JMeter - Listener - "BeanShell Listener"


The content has been moved to PerfMatrix site.


JMeter - Listener - "Graph Results"


The content has been moved to PerfMatrix site.


Next Topic:
Apache JMeter - Listener - "BeanShell Listener"

Previous Topic:
Apache JMeter - Listener - "Assertion Results" Element

Related Topics:


JMeter - Listener - "Assertion Results"


The content has been moved to PerfMatrix Site.

Previous Topic:
Apache JMeter - "Listener" Element

Related Topics:


JMeter - "Listener" Element

The content has been moved to PerfMatrix site.

Link: https://www.perfmatrix.com/jmeter-listener/

Next Topic:
Apache JMeter - Listener - "Assertion Results"

Previous Topic:
Apache JMeter - Assertion - "Compare Assertion" Element

Related Topics:


JMeter - Assertion - "XML Schema Assertion"

As discussed in the earlier post XML Assertion is a generic assertion element which is mainly used to validate the format of XML embedded in the response. When we have a requirement to validate the specific XML response then XML Schema Assertion is used. In this type of assertion, we can provide the XML Schema file (along with path) which needs to be compared with the actual response. When the response is matched with the schema then the sampler is passed else failed with an error.
How to add "XML Schema Assertion" element?
You can follow the below steps:
1. Select "Sampler" node whose response needs to be validated.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "XML Schema Assertion"

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

What are the attributes of "XML 
Schema Assertion" element?

"XML Schema Assertion" has the following attributes:
  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)
  • XML Schema: To specify the path and file name of the schema.  
Next Topic:
Apache JMeter - Assertion - "HTML Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "JSR223 Assertions" Element

Related Topics:


  

JMeter - Assertion - "MD5Hex Assertion"

MD5Hex Assertion is used to validate MD5 hash value of the response data. To get more information on MD5 hash click here.

How to add "MD5Hex Assertion" element?
You can follow the below steps:
1. Select "Sampler" node whose response duration needs to be validated.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "MD5Hex Assertion"

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

What are the attributes of "MD5Hex Assertion" element?

"MD5Hex Assertion" has the following attributes:
  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)
  • MD5Hex to Assert: Write the 32 digits MD5 hash value in 'MD5Hex' field which needs to be expected in the response. The value is not case-sensitive.  
Next Topic:
Apache JMeter - Assertion - "XML Schema Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "JSR223 Assertions" Element

Related Topics:


  

JMeter - Assertion - "JSR223 Assertion"

JSR223 Assertion is a scripting-based assertion element. JSR stands for Java Specification Requests. As same as BeanShell Assertion which we discussed earlier; you will need to implement the assertion logic by yourself using one of the supported scripting languages like Groovy, BeanShell, java, javascript, jexl etc. Usually, it is helpful when you need to write custom code based on some unique algorithm which is not currently provided by JMeter. You can create your own implementation of the code using JSR223 Assertion. 
How to add "JSR223 Assertion" element?
You can follow the 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 "JSR223 Assertion"

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

What are the attributes of "JSR223 Assertion" element?

"JSR Assertion" has following attributes:
  • Name: To provide the name of the assertion
  • Comments: To provide arbitrary comments (if any)
  • Language: To choose scripting language. 
  • Parameters: Parameters to pass to the script. This is an optional attribute.  
  • Script file: A file containing the script to run. The return value is the desired output.
  • Script compilation caching: Unique String across Test Plan that JMeter will use to cache the result of script compilation if the language used supports Compilable interface (Groovy is one of these, java, BeanShell and javascript are not)
  • Script: The manual script which contains the assertion logic.
Recommendation: It is recommended to use JSR223 test elements and Groovy as a language for any scripting. Groovy scripting is as fast as Java while BeanShell and JavaScript need to be interpreted, which causes some performance overhead. 

Next Topic:
Apache JMeter - Assertion - "MD5Hex Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "BeanShell Assertions" Element

Related Topics:


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:


  

JMeter - Assertions - "XML Assertion"

XML Assertion is mainly used to validate the format of XML embedded in the response. This type of assertion does not need any input. When the response is well XML formatted then the sampler is passed else failed with an error.

Failure Case:
How to add "XML Assertion" element?
You can follow the below steps:
1. Select "Sampler" node whose response duration needs to be validated.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "XML Assertion"

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

What are the attributes of "XML Assertion" element?

"XML Assertion" has the following attributes:
  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)  
Next Topic:
Apache JMeter - Assertion - "BeanShell Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "Size Assertions" Element

Related Topics:


  

JMeter - Assertions - "Size Assertion"

Size Assertion is mainly used when we want to validate the size of the full response or some part of the response like header, code etc. This assertion helps to identify the throughput related issue. A simple scenario where you can add size assertion is a file downloading scenario.
How to add "Size Assertion" element?
You can follow the below steps:
1. Select "Sampler" node whose response duration needs to be validated.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "Size Assertion"

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

What are the attributes of "Size Assertion" element?

"Size Assertion" has the following attributes:
  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)
  • Apply to: To define the search scope. 
  •  Main sample and sub-samples: In case, the request is redirected then use this option, so that the response will be the sum of both main and re-directed request response size and can be compared with the expected response size.
  • Main sample only: This option can be selected when we want to validate the response size of main sample only.
  • Sub-samples only: When request is re-directed and the response size comparison is needed only for sub-sample (re-directed) method then this option needs to be selected.
  • JMeter Variable Name to use: To validate the size of JMeter variable.  
  • Response Size Field to Test: This option is used to specify the part of response whose size needs to be validated. 
  • Full Response: It includes both response header as well as response body size and the sum is compared with expected size figure given in 'Size to Assert' field. 
  • Response Hearders: Only the size of response header is compared with the given size. 
  • Response Code: The size of the response code (around 3 bytes) is compared with the given size assertion.
  • Response Message: The given size asserion is compared with response message size.
  • Size to Assert: The expected size of the response needs to be provided in the 'Size in bytes' field which is compared with the actual response size using given condition in 'Types of Comparison' field.
  • Types of Comparison:  JMeter provides all the possible comparison method like equal to (=), not equal to (!=), greater than (>), less than (<), greater than or equal to (>=) and less than or equal to (<=) to compare the actual and expected response size. 
Some Key Rules related to Size Assertion:
1. Size assertion follows scope policy means if we add size assertion at transaction level then the assertion is applicable to all the samplers under the same transaction. 
2. Expected size must be given in bytes.
3. Expected size value can be parametrized.
4. You can define Global Size Assertion under the test plan which will be applicable to all the samplers.    
  
Next Topic:
Apache JMeter - Assertion - "XML Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "Duration Assertions" Element

Related Topics:


  

JMeter - Assertions - "Duration Assertion"

Duration Assertion is mainly used when we have response time NFR and on the basis of those figures, we want to make a sampler or transaction controller pass or fail. It is a simple assertion element where we just need to provide 'apply to' and 'duration' input.
How to add "Duration Assertion" element?
You can follow the below steps:
1. Select "Sampler" node whose response duration needs to be validated.
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Assertions"
5. Click "Duration Assertions"

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

What are the attributes of "Duration Assertion" element?

"Duration Assertion" has the following attributes:
  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)
  • Apply to: To define the search scope. 
  •  Main sample and sub-samples: In case, the request is redirected then use this option, so that the response time duration will be the sum of both main and re-directed request response time and can be compared with the expected duration.
  • Main sample only: This option can be selected when we want to validate the response time of main sample only.
  • Sub-samples only: When request is re-directed and the response time duration comparison is needed only for sub-sample (re-directed) method then this option needs to be selected.
  • Duration to Assert: The expected response time duration needs to be provided in the 'Duration in milliseconds' field which will be compared with the actual response time duration and a decision will be made. When the actual duration is more than the expected duration then the sampler will be marked as failed whereas when the actual duration is less than the expected duration then the result will be treated as pass. 
Some Key Rules related to Duration Assertion:
1. Duration assertion follows scope policy means if we add duration assertion at transaction level then the assertion is applicable to all the samplers under the same transaction. 
2. Duration should be given in milliseconds.
3. Duration value can be parametrized.
4. You can define Global Duration Assertion under the test plan which will be applicable to all the samplers.    
  
Next Topic:
Apache JMeter - Assertion - "Size Assertion" Element

Previous Topic:

Apache JMeter - Assertion - "Response Assertions" Element

Related Topics: