JMeter will save the element selected, plus all the child elements beneath it. By default, JMeter doesn't save the elements, you need to explicitly save it as mentioned earlier. JMeter Performance Testing. Apache JMeter is a great performance testing tool that is used heavily within the Java community. Install JMeter. Linux and Mac. Steps to Launch JMeter. Go to your JMeter bin folder to launch JMeter, in our case it would be C: Users lsharm Downloads apache-jmeter-3.0 bin and locate appropriate file. You can also run ApacheJmeter.jar in order to launch JMeter. Click on Run button to move forward. You will see a command prompt started as well.
First of all, we should understandwhat Apache JMeter is. Apache JMeter is open-source software that is builtusing Java programming language. It was first developed by Stefano Mazzocchi ofthe Apache Software Foundation.
JMeter is designed to perform load testing and performance testing. Using this tool we can measure the performance of web applications. Now when we say performance testing, it means that heavy load of concurrent users is generated on the web application to measure its performance.
Not only we do performance testing using JMeter, but also we are using it for functional testing, database server testing, etc.
Why JMeter?
Let us understand it using a scenario. Suppose we have the requirement that we need to test a web server and check how many concurrent users can it handle? Let us consider another scenario where we have a requirement to test any particular web application, say google.com for 1000 users. For that, we need to arrange 1000 people simultaneously accessing google.com at a time, which is very difficult to manage or almost impossible to manage. For that, we need a performance testing tool which generates and simulates a large number of concurrent user load on the web server. JMeter, being open source free tool, comes to rescue in such situations.
JMeter Advantages
JMeterhas many advantages. Some of them are given below.
- Open Source: JMeteris open source which means that JMeter is totally free. We do not need topurchase license for JMeter.
- Friendly GUI:JMeter has very simple interface which makes it very easy to use.
- Platform independent:One of the biggest advantages of JMeter is that it can run on multipleplatforms. It is not limited to Windows or Linux or any particular operatingsystem.
- Full multithreading framework. – JMeter provides multi trading Framework which means thatit allows execution of different threads simultaneously for simulating load oflarge number of users.
- Visualize Test Result:JMeter write the facility to display the result in different formats such aschart, table, tree and log file which makes it is easy to analyse the result
- Easy installation:JMeter is very easy to install. We just need to run the *.bat file available indownloaded JMeter folder to run JMeter. We don’t need to install it.
- Highly Extensible:There are many plugins available for JMeter which makes it highly extensibleand powerful.
- Multiple testing strategies: JMeter supports various types of testing such as LoadTesting, Distributed Testing, and Functional Testing.
- Support multi-protocol:Being such a light weighted tool, JMeter does not only support web applicationtesting but also is used to monitor database server performance. All basicprotocols which are supported by licensed tools such as HTTP, JDBC, LDAP, SOAP,JMS, and FTP, are supported by JMeter which is really great.
- Record & Playback– like other licensed tools which office facility of record and playback,JMeter also had the same facility which allows it to record the user action onthe browser and replay the same action on the web application using JMeter.
- Script Test: Animportant advantage of JMeter is that JMeter can be integrated with Bean Shell& Selenium for automated testing.
How JMeter works?
Firstthing that is done by the JMeter is that it creates request for target serverwhich then simulates it for number of users after server receives request fromJMeter, it sends the request back to JMeter for number of users, which iscollected by JMeter which in turn returns statistical information from thetarget server through graphical diagrams
JMeter Version History
Version | Description |
1 | first official release |
2.13 | Java 6+ |
3 | Java 7+ |
3.1 | Java 7+ |
3.2 | Java 8+ |
3.3 | Java 8 |
4 | Java 8 / 9 |
System Requirement
JDK | 1.6 or above. |
Memory | No minimum requirement. |
Disk Space | No minimum requirement. |
Operating System | No minimum requirement. |
Let us look atthe following steps in order to download and run JMeter.
Step 1: Verify JavaInstallation
Jmeter 5.0 Download
For runningJMeter, the first thing which is required is that Java should be installed onthe system where we have to run JMeter. Let us understand how to verify whetherJava is installed on the system or not. For that we need to go to console andexecute the following commands for different operating systems.
OS | Command |
Windows | c:> java –version on Command Pompt |
Linux | $ java –version on Command Terminal |
Mac | $ java –version on Terminal |
After gettingabove commands on the operating systems, as given above, we get to know of theJava version which is installed on the system. It will also give a message likeno Java version is installed on the system if java is not installed on thesystem. We need to install it before moving to the next step which is to setupa java environment variable in the system.
Step 2: Set Java Environment
Next important thing is to set JAVA_HOME environment variable which refers to the location where Java is installed on the system. We can set this variable As given below for different operating systems.
Download Jmeter On Mac
Windows OS: Need to create environment variableJAVA_HOME and Set its value to C:Program FilesJavajdk1.7.0_25.
Linux:Export JAVA_HOME=/usr/local/java-current
Mac: Export JAVA_HOME=/Library/Java/Home
Next important thing is to add Java compiler location to System Path.
Windows: Need to add another string- C:ProgramFilesJavajdk1.7.0_25bin to the end of the system variable: Path.
Linux: Export PATH=$PATH:$JAVA_HOME/bin/
Mac: Not required
In the example above we have installed jdk1.7.0_25 version of Java on our system. So we are setting environment variables accordingly. We need to set the java version according to the version installed on our system. After setting environment variables we can verify which version of Java is installed on the system using commands which we did earlier.
Step 3: Download JMeter
Download thelatest version of JMeter from https://jmeter.apache.org/download_jmeter.cgi.
We can downloadit to any directory. But for this tutorial we have downloaded apache-jmeter-2.9and copied it into C:>JMeter folder.
Step 4: Run JMeter
Now afterdownloading JMeter, we are required to run JMeter. For that we need to go tothe bin directory. In this case, it is / folder name am where Apache JMeter hasbeen copied/apache-jmeter-2.9/bin. Now when we are in Bin folder, we need toclick on the following depending on the type of operating systems, as givenbelow.
OS | File Name |
Windows | jmeter.bat |
Linux | jmeter.sh |
Mac | jmeter.sh |
Let us take the example of Windows operating system, we need to click on jmeter.bat file which is a batch file and resides inside bin folder. After clicking on this batch file, JMeter window will open and after opening of this window we have graphical user interface ready for performance testing. Now that we have seen the steps on how to download and open JMeter GUI, we can easily say that it is very easy to install.
In the next tutorial, you will learn how to install JMeter in Windows 10
LINUX
1. Download JMeter
a. http://www.bizdirusa.com/mirrors/apache//jmeter/binaries/apache-jmeter-2.8.tgz
2. Unzip the file and move it to your convenient directory
3. Use Jdk 1.5 or higher version
4. Set environment variables JAVA_HOME, JMETER_HOME, PATH
5. Create the test plan (jmx file) and place it in a folder
Here we are going to use /extras / est.jmx for execution
6. Create a sh file for executing the jmx “jmeter.sh”, I created in extras
7. If you are not able to set the environment variable you can define that in sh file
JAVA_HOME=/local/apps/3rdparty/java
JMETER_HOME=/local/apps/3rdparty/jmeter/apache-jmeter-2.8
JVM_ARGS=”-Xms512m -Xmx512m”
# Add Mac-specific property – should be ignored elsewhere (Bug 47064)
$JAVA_HOME/bin/java -jar $JMETER_HOME/bin/ApacheJMeter.jar -n -t Test.jmx
8. Its time to run sh jmeter.sh
9. You can edit jmx in vi editor it’s a form of xml