Thursday, July 9, 2015

Recording Load Test Script With JMeter

We have little bit knowledge on different components of JMeter and we know how to create a script. But in real world it is very hard to create a load test script in such a manner, because there is lots of steps and lots of different type of user activity. So it is good if we generate script as per user activity.

Here JMeter provide us this functionality where we record our script as per user action. JMeter comes with recording template for this facility. Though we can create JMeter script without this template, we need to add  HTTP(s) Test Script Recorder (Add ->Non-Test Elements-> HTTP(s) Test Script Recorder) under WorkBeanch and also need to add Recording Controller(Add -> Logic Controller -> Recording Controller) under Thread  Group.  Here we deals with JMeter Template .

Step 1 :

 Open JMeter GUI .

Step 2 :

 Choose Template option from File -> Templates... 
Step 3 : 

 Select Recording Option from Select Template dropdown option.
Step 4 :

 Click on create button then Template modal option closed and JMeter GUI looks like that.

Step 5 :

 Set a port number for recording our script.


Step 6 :

 Set the same port number in browser. We use Firefox as a browser for recording our script so we set port number from Tools -> Options ->Advanced ->Network

Step 7 :

Default selected option in  Target Controller as Use Recording Controller if we want to store our recorded script under Test Plan -> Thread  then select Test Plan-> Thread Group from Target Controller






Step 8 : 

We can group our recorded script when we record our script. We can do this using different type of Grouping option from Grouping dropdown option. Default option in Grouping is Put each group in a new transaction controller .







Step 9 :

 Select URL pattern to exclude from recording script, we need to add the file type here .

Step 10 :

Now we start to recording the script for load testing.


Step 11 :

 If Apache certificate, which is located in JMeter bin folder is not installed in machine the this pop up will be shown but we can click on OK and proceed further.
Step 12 :

  We open Google page in browser and observe that google page opened into the browser and we can observe that HTTP Sampler added under Test Plan ->Thread Group .

We can now record our script after following the above mentioned script.

 





No comments:

Post a Comment