I visited http://jakarta.apache.org/jmeter/usermanual/test_plan.html page today, as for long I was trying to find out what all these options, which come up with the right click, mean. These options are the Elements of a Test Plan. The three basic elements of a Test Plan are:
• Thread group
• Samplers
• Listeners
Others are:
▪ Controllers
▪ Logic Controllers
▪ Timers
▪ Assertions
▪ Configuration Elements
▪ Pre-Processor Elements
▪ Post-Processor Elements
The best place to understand what they are is to visit http://jakarta.apache.org/jmeter/usermanual/test_plan.html. They have been explained well there. For now I have been able to understand Thread Group. A Thread Group is the Big Daddy of a Test Plan. Every other element is the child or the sub-child of a 'Thread Group'
A Thread Group allows you to control:
- the number of threads
- the ramp-up period
- the number of times to execute the test
The two things 'number of threads' and 'number of times to execute the test' are very much understood but the confusing point is the ramp-up period. The ramp up period is nothing but the period after which the next thread start. It should be set with care. An simple example is... suppose we have 10 threads and we have set the ramp up period as 100, then all the threads will be up and running within 100 seconds. That implies, that Each thread will start 10 (100/10) seconds after the previous thread was begun.
Friday, February 15, 2008
Monday, January 28, 2008
Running the first Test
In my last post I shared how to record a Test. Now is the time to run it. Running a Test means that now we are going to have the results of our test here. Before we go into the detailed step to step I want to share something about the Listeners. Listeners are the Elements of a Jmeter Script which are used to view the response. You can see that we have a number of listeners. To view this list Right-Click on Thread Group and then select "Add > Listeners".

In my last post we have added a listener 'View Results Tree' and now we are going to see why we have added that.
Pre-Condition: It is assumed that you have recently recorded the test as told in my last post. If you haven't read my last post then better read it first and if you are in no mood to do that then I am assuming that you have already recorder a test and your proxies has been set on the browser. Moreover, Open your test script on the Jmeter before starting the following steps
1. Select the Listener, 'View Results Tree' in my case, from the Left Panel

2. Click on "Run > Start" or use the keyboard shortcut '^-R' (Ctrl+R on Windows)

3. Observe that when the Listener is selected, a list of results is displayed on the Jmeter and are displayed according to the Listener which was selected. In our case, as we have selected 'View Results Tree' listener, the list of results is displayed in a form of a tree as displayed below.

When a node from this tree is selected, the specific information related to the node is displayed on the right side of the page.

Similarly, different results can be observed using different Listeners. Each Listener displays the same output in a different way. These different ways are helpful in testing the different areas.
So I have told you about how to run a Jmeter Test Script and how to use listeners to view the results, in a very graphical way. Now go ahead and try to use each and every listener on the test script and observe the difference yourself

In my last post we have added a listener 'View Results Tree' and now we are going to see why we have added that.
Pre-Condition: It is assumed that you have recently recorded the test as told in my last post. If you haven't read my last post then better read it first and if you are in no mood to do that then I am assuming that you have already recorder a test and your proxies has been set on the browser. Moreover, Open your test script on the Jmeter before starting the following steps
1. Select the Listener, 'View Results Tree' in my case, from the Left Panel

2. Click on "Run > Start" or use the keyboard shortcut '^-R' (Ctrl+R on Windows)

3. Observe that when the Listener is selected, a list of results is displayed on the Jmeter and are displayed according to the Listener which was selected. In our case, as we have selected 'View Results Tree' listener, the list of results is displayed in a form of a tree as displayed below.

When a node from this tree is selected, the specific information related to the node is displayed on the right side of the page.

Similarly, different results can be observed using different Listeners. Each Listener displays the same output in a different way. These different ways are helpful in testing the different areas.
So I have told you about how to run a Jmeter Test Script and how to use listeners to view the results, in a very graphical way. Now go ahead and try to use each and every listener on the test script and observe the difference yourself
Recording a Test Plan - Quickly
Jmeter is simply to test the load. To test the first thing we need is a Test Plan. In Jmeter, creating a test plan is to record a test. Lemme explain myself. I start the (recording on) Jmeter and run through the steps which I have to perform for a specific test. Once I have recorded the steps that means I have told Jmeter what to do again and again with a loads of users. I have to run through the steps at least once to teach Jmeter how to do it. Jmeter is a quick learner [but still dumb]
Now lets run through the steps to be used to record a test. Jakarta has already created a tutorial on this and that could be found here in PDF format.
1. Start Jmeter
2. Right click (cmd-click) on the “test plan” and add a new thread group: add -> thread group

3. Right click (cmd-click) on Thread Group and select "add -> config element -> Http Request Defaults"

4. Server name – enter “jakarta.apache.org”
5. Port number – enter “80”
6. Protocol – enter “HTTP”

7.Right click (cmd-click) on workbench and add the Http proxy: add -> non-test elements -> Http
Proxy Server

8. Port field - Enter “8080” [Rest is not necessary for now]

Though this much information is enough for Jmeter to run a site, but you'll reach no where with this. So we have to add some listeners to read the response.
9. Right click on Thread Group and select "add -> listener -> View Results Tree"

Now comes the crucial part: making Proxy Server. In simple language, what we need now is to make our explorer to request Jmeter with each and every action. The Proxy thus created will be helpful in scanning the outcome of the steps we perform on the explorer. You don't understand? No worries :) lets follow the following steps everything will be clear. I am using a Mozilla Firefox explorer. Same could be done on IE or Safari or any other explorer out there.
10. On Firefox, Go to Tools > Options [ or Firefox > Preferences, on Mac]
11. Click on 'Advanced' tab and then on 'Network' sub-tab in Options

12. Click on Settings button
13. Select 'Manual Proxy Configuration' radio button
14. HTTP Proxy: localhost
15. Port: 8080 [This should be same as the one put in Port filed under WorkBench > HTTP Proxy server in Jmeter settings]

Phew! all the settings part is over now. Now lets teach Jmeter a lesson :)
16. On Jmeter select "WorkBench > HTTP Proxy Server"
17. Click on 'Start'
18. On Firefox (or the browser for which the Proxy has been set) enter http://jakarta.apache.org/jmeter/index.html in the address bar.
19. Click on few links here and there
Notice that some information is being added, automatically, to the left hand Panel of Jmeter

20. On Jmeter, click 'Stop'
This is it, Bingo! we have just recorded a Test. But What is the use of it? The answer will be in my next post... till then enjoy created test plans. There are many ways to do the same thing on Jmeter. Some of these are as below:
1. Test Your Web Application's Performance | Yet another Tech Blog
2. Load Testing with Apache JMeter
3. Load Testing your Applications with Apache JMeter
Now lets run through the steps to be used to record a test. Jakarta has already created a tutorial on this and that could be found here in PDF format.
1. Start Jmeter
2. Right click (cmd-click) on the “test plan” and add a new thread group: add -> thread group
3. Right click (cmd-click) on Thread Group and select "add -> config element -> Http Request Defaults"

4. Server name – enter “jakarta.apache.org”
5. Port number – enter “80”
6. Protocol – enter “HTTP”

7.Right click (cmd-click) on workbench and add the Http proxy: add -> non-test elements -> Http
Proxy Server

8. Port field - Enter “8080” [Rest is not necessary for now]

Though this much information is enough for Jmeter to run a site, but you'll reach no where with this. So we have to add some listeners to read the response.
9. Right click on Thread Group and select "add -> listener -> View Results Tree"

Now comes the crucial part: making Proxy Server. In simple language, what we need now is to make our explorer to request Jmeter with each and every action. The Proxy thus created will be helpful in scanning the outcome of the steps we perform on the explorer. You don't understand? No worries :) lets follow the following steps everything will be clear. I am using a Mozilla Firefox explorer. Same could be done on IE or Safari or any other explorer out there.
10. On Firefox, Go to Tools > Options [ or Firefox > Preferences, on Mac]
11. Click on 'Advanced' tab and then on 'Network' sub-tab in Options

12. Click on Settings button
13. Select 'Manual Proxy Configuration' radio button
14. HTTP Proxy: localhost
15. Port: 8080 [This should be same as the one put in Port filed under WorkBench > HTTP Proxy server in Jmeter settings]

Phew! all the settings part is over now. Now lets teach Jmeter a lesson :)
16. On Jmeter select "WorkBench > HTTP Proxy Server"
17. Click on 'Start'
18. On Firefox (or the browser for which the Proxy has been set) enter http://jakarta.apache.org/jmeter/index.html in the address bar.
19. Click on few links here and there
Notice that some information is being added, automatically, to the left hand Panel of Jmeter

20. On Jmeter, click 'Stop'
This is it, Bingo! we have just recorded a Test. But What is the use of it? The answer will be in my next post... till then enjoy created test plans. There are many ways to do the same thing on Jmeter. Some of these are as below:
1. Test Your Web Application's Performance | Yet another Tech Blog
2. Load Testing with Apache JMeter
3. Load Testing your Applications with Apache JMeter
Starting Jmeter
It all started when I was told that now we are going to use a Tool for Load Testing in our company. “The name of the Tool is 'Jmeter' and you've to learn it first and then take forward the team with that”, Tarun told me a couple of days back. Now I was provided a Java utility and was scraching my head hard [As there was not much documentation available] to make that thing work when this very horrible idea stuck me, “How I am going to teach this tool to my team mates and the other people who are going to join soon”? I got the answer as soon as this idea stuck me. It occured to me that I should write everything up. So that whenever someone asks me that what is Jmeter, I can say, 'This is link on everything I know about Jmeter, go check it out'. So starting today, I'll add everything, which I learn about Jmeter, daily untill the day I leave learning it.
So, what is Jmeter? The complete theoretical definition is here at wikipedia
The best place to start Jmeter is its official site http://jakarta.apache.org/jmeter/index.html. This link tells a lot about What is Jmeter? and all that stuff. So better start with that. Then download Jmeter. Lets do it step by step, so that if you don't feel like missing anything.
DOWNLOAD JMETER:
1. Go to http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi and you can see something like:

2. Click on the appropriate link with respect to the OS you are using. This will start the download
3. The downloaded file is in a compressed format (.zip or .tgz). Use a decompressing software like (winzip or uncompressor or 7-zip etc.) to decompress it.
4. The decompressed folder structure will be something like this:
jakarta-jmeter
+bin
+docs
+extras
+lib
+printable_docs
-licence
-manifest
-notice
-readme
Once the Jmeter folder has been decompressed, it is the time to run it for the first time. Follow the following steps:
1. Open a Terminal [Command Prompt in Windows]
2. Navigate to the jakarta folder using the cd command
3. Once your are in jakarta-jmeter folder type the following commands:
cd bin
sh jmeter.sh [...for Windows simply type: jmeter]

A new Jmeter window will appear as below:
So, what is Jmeter? The complete theoretical definition is here at wikipedia
The best place to start Jmeter is its official site http://jakarta.apache.org/jmeter/index.html. This link tells a lot about What is Jmeter? and all that stuff. So better start with that. Then download Jmeter. Lets do it step by step, so that if you don't feel like missing anything.
DOWNLOAD JMETER:
1. Go to http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi and you can see something like:

2. Click on the appropriate link with respect to the OS you are using. This will start the download
3. The downloaded file is in a compressed format (.zip or .tgz). Use a decompressing software like (winzip or uncompressor or 7-zip etc.) to decompress it.
4. The decompressed folder structure will be something like this:
jakarta-jmeter
+bin
+docs
+extras
+lib
+printable_docs
-licence
-manifest
-notice
-readme
Once the Jmeter folder has been decompressed, it is the time to run it for the first time. Follow the following steps:
1. Open a Terminal [Command Prompt in Windows]
2. Navigate to the jakarta folder using the cd command
3. Once your are in jakarta-jmeter folder type the following commands:
cd bin
sh jmeter.sh [...for Windows simply type: jmeter]

A new Jmeter window will appear as below:
Subscribe to:
Comments (Atom)