понедељак, 14. октобар 2013.

How to Save Response Data in Jmeter

It is very useful sometimes to save response data to external file, especially when we run Jmeter tests with ANT or Maven.

It is very easy to export response data to external file. Jmeter offers Save Response to a File listener. Click on picture to enlarge.





By default, file is saved in bin directory.

четвртак, 10. октобар 2013.

How to use JMeter's 'IF' Controller


 

In this post I will explain you what should you do if you need to execute Jmeter HTTP Requests based on a specific condition.

It is very easy! Jmeter has If controller allowing to control whether its children are run or not.

Let's suppose our test plan look as on the picture:



Condition is shown in the picture bellow:




Child of If Controller ("Do Something") in this case, will be executed only when variable counter has value 1. This is very useful when we run test with many users, but some steps should not be executed for all users.

Use quotes when you compare strings. Example: "${your_variable}" == "jhsajdhjkashd"

 

среда, 9. октобар 2013.

How to extract value from JDBC response - Jmeter

Jmeter Example - How to extract value from JDBC response

In this post I will explain how to extract an element from the JDBC response using the Regular Expression Extractor and store it in a variable which can be referred from further requests.

1) Create JDBC request in your Jmeter Test Plan and enter your SQL querry. For example:

                 Select ID from USER where USERNAME='DRAGAN'
     


        
 JDBC Response should look as on the picture bellow:


 2) Add Regular Expression Extractor to JDBS requests as it shown on the picture bellow:


Value 45621 should be stored in the variable userId, and you can use this variable in furher requests.