jMeter – Web Test Plan

jMeter – Web Test Plan ”; Previous Next Let us build a simple test plan which tests a web page. We write a test plan in Apache JMeter so that we can test the performance of the web page shown by the URL − www.tutorialspoint.com. Start JMeter Open the JMeter window by clicking on /home/manisha/apache-jmeter-2.9/bin/jmeter.sh. The JMeter window appear as below − Rename the Test Plan Change the name of test plan node to Sample Test in the Name text box. You need to change the focus to workbench node and back to the Test Plan node to see the name getting reflected. Add Thread Group Now we add our first element in the window. We add one Thread Group, which is a placeholder for all other elements like Samplers, Controllers, and Listeners. We need one so we can configure number of users to simulate. In JMeter, all the node elements are added by using the context menu. Right-click the element where you want to add a child element node. Choose the appropriate option to add. Right-click on the Sample Test (our Test Plan) → Add → Threads (Users) → Thread Group. Thus, the Thread Group gets added under the Test Plan (Sample Test) node. Name the Thread Group as Users. For us, this element means users visiting the TutorialsPoint Home Page. Add Sampler We need to add one Sampler in our Thread Group (Users). As done earlier for adding Thread group, this time we will open the context menu of the Thread Group (Users) node by right-clicking and we will add HTTP Request Sampler by choosing Add → Sampler → HTTP request option. It will add one empty HTTP Request Sampler under the Thread Group (Users) node. Let us configure this node element − Name − We will change the name to reflect the action what we want to achieve. We will name it as Visit TutorialsPoint Home Page Server Name or IP − Here, we have to type the web server name. In our case it is www.tutorialspoint.com. (http:// part is not written this is only the name of the server or its IP) Protocol − We will keep this blank, which means we want HTTP as the protocol. Path − We will type path as / (slash). It means we want the root page of the server. Add Listener We will now add a listener. Let us add View Results Tree Listener under the Thread Group (User) node. It will ensure that the results of the Sampler will be available to view in this Listener node element. To add a listener − Open the context menu Right-click the Thread Group (Users) Choose Add → Listener → View Results Tree option Run the Test Plan Now with all the setup, let us execute the test plan. With the configuration of the Thread Group (Users), we keep all the default values. It means JMeter will execute the sampler only once. It is similar to a single user, only once. This is similar to a user visiting a web page through browser, with JMeter sampler. To execute the test plan, Select Run from the menu and select Start option. Apache JMeter asks us to save the test plan in a disk file before actually starting the test. This is important if you want to run the test plan multiple times. You can opt for running it without saving too. View the Output We have kept the setting of the thread group as single thread (one user only) and loop for 1 time (run only one time), hence we will get the result of one single transaction in the View Result Tree Listener. Details of the above result are − Green color against the name Visit TutorialsPoint Home Page indicates success. JMeter has stored all the headers and the responses sent by the web server and ready to show us the result in many ways. The first tab is Sampler Results. It shows JMeter data as well as data returned by the web server. The second tab is Request, which shows all the data sent to the web server as part of the request. The last tab is Response data. In this tab, the listener shows the data received from server in text format. This is just a simple test plan which executes only one request. But JMeter”s real strength is in sending the same request, as if many users are sending it. To test the web servers with multiple users, we need to change the Thread Group (Users) settings. Print Page Previous Next Advertisements ”;

jMeter – Listeners

jMeter – Listeners ”; Previous Next Listeners provide access to the information JMeter gathers about the test cases while JMeter runs. The results or information gathered by listeners can be shown in the form of − tree tables graphs log file All listeners write the same raw data to the output file when one is specified. Default Configuration The default items to be saved can be defined in one of the following two ways − In the jmeter.properties (or user.properties) file. This file is present in the /bin folder of JMeter.To change the default format, find the following line in jmeter.properties − jmeter.save.saveservice.output_format= By using the Config popup as shown in the following screenshot − JMeter creates results of a test run as JMeter Text Logs(JTL). These are normally called JTL files, as that is the default extension − but any extension can be used. If multiple tests are run using the same output file name, then JMeter automatically appends new data at the end of the file. The listener can record results to a file but not to the UI. It is meant to provide an efficient means of recording data by eliminating GUI overhead. When running in − GUI mode − use the listener Simple Data Writer non-GUI mode − the -l flag can be used to create a data file. Listeners can use a lot of memory if there are a lot of samples. To minimize the amount of memory needed, use the Simple Data Write with CSV format. CSV Log format The CSV log format depends on which data items are selected in the configuration. Only the specified data items are recorded in the file. The order of appearance of columns is fixed, and is as follows − Field Description Value Example timeStamp in milliseconds since 1/1/1970 1354223881017 elapsed in milliseconds 1858 label sampler label HTTP Request responseCode e.g. 200, 404 200 responseMessage e.g. OK OK threadName Thread Group 1-1 dataType e.g. text text success true or false true failureMessage if any bytes number of bytes in the sample 34908 grpThreads number of active threads in this thread group 1 allThreads total number of active threads in all groups 1 URL http://tutorialspoint.com Filename if Save Response to File was used latency time to first response 132 encoding utf-8 SampleCount number of samples (1, unless multiple samples are aggregated) 1 ErrorCount number of errors (0 or 1, unless multiple samples are aggregated) 0 Hostname where the sample was generated LaptopManisha IdleTime number of milliseconds of ”Idle” time (normally 0) Variables if specified Saving Response Data The response data can be saved in the XML log file if required. However it does not allow to save large files and images. In such cases, use the Post-Processor Save_Responses_to_a_file. This generates a new file for each sample, and saves the file name with the sample. The file name can then be included in the sample log output. The data will be retrieved from the file if necessary when the sample log file is reloaded. Loading (reading) response data To view an existing results file, you can use the file “Browse…” button to select a file. If necessary, just create a dummy testplan with the appropriate Listener in it. Saving the Listener GUI Data JMeter is capable of saving any listener as a PNG file. To do so, Select the listener in the left panel by selecting Edit → Save As Image. A file dialog appears. Enter the desired name. Save the listener. Print Page Previous Next Advertisements ”;

jMeter – Webservice Test Plan

jMeter – Webservice Test Plan ”; Previous Next In this chapter, we will learn how to create a Test Plan to test a WebService. For our test purpose, we have created a simple webservice project and deployed it on the Tomcat server locally. Create Webservice Project To create a webservice project, we have used Eclipse IDE. First write the Service Endpoint Interface HelloWorld under the package com.tutorialspoint.ws. The contents of the HelloWorld.java are as follows − package com.tutorialspoint.ws; import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; //Service Endpoint Interface @WebService @SOAPBinding(style = Style.RPC) public interface HelloWorld { @WebMethod String getHelloWorldMessage(String string); } This service has a method getHelloWorldMessage which takes a String parameter. Next, create the implementation class HelloWorldImpl.java under the package com.tutorialspoint.ws. package com.tutorialspoint.ws; import javax.jws.WebService; @WebService(endpointInterface=”com.tutorialspoint.ws.HelloWorld”) public class HelloWorldImpl implements HelloWorld { @Override public String getHelloWorldMessage(String myName) { return(“Hello “+myName+” to JAX WS world”); } } Let us now publish this web service locally by creating the Endpoint publisher and expose the service on the server. The publish method takes two parameters − Endpoint URL String. Implementor object, in this case the HelloWorld implementation class, which is exposed as a Web Service at the endpoint identified by the URL mentioned in the parameter above. The contents of HelloWorldPublisher.java are as follows − package com.tutorialspoint.endpoint; import javax.xml.ws.Endpoint; import com.tutorialspoint.ws.HelloWorldImpl; public class HelloWorldPublisher { public static void main(String[] args) { Endpoint.publish(“http://localhost:9000/ws/hello”, new HelloWorldImpl()); } } Modify the web.xml contents as shown below − <?xml version = “1.0” encoding = “UTF-8”?> <!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/j2ee/dtds/web-app_2_3.dtd”> <web-app> <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener> <servlet> <servlet-name>hello</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> <session-config> <session-timeout>120</session-timeout> </session-config> </web-app> To deploy this application as a webservice, we would need another configuration file sun-jaxws.xml. The contents of this file are as follows − <?xml version = “1.0” encoding = “UTF-8”?> <endpoints xmlns = “http://java.sun.com/xml/ns/jax-ws/ri/runtime” version = “2.0”> <endpoint name = “HelloWorld” implementation = “com.tutorialspoint.ws.HelloWorldImpl” url-pattern = “/hello”/> </endpoints> Now that all the files are ready, the directory structure would look as shown in the following screenshot − Now create a WAR file of this application. Choose the project → right click → Export → WAR file. Save this as hello.war file under the webapps folder of Tomcat server. Now start the Tomcat server. Once the server is started, you should be able to access the webservice with the URL − http://localhost:8080/hello/hello Create JMeter Test plan Now let us create a test plan to test the above webservice. Rename the Test Plan Open the JMeter window by clicking /home/manisha/apache-jmeter2.9/bin/jmeter.sh. Click the Test Plan node. Rename this Test Plan node as WebserviceTest. Add Thread Group Add one Thread Group, which is placeholder for all other elements like Samplers, Controllers, and Listeners. Right click on WebserviceTest (our Test Plan) → Add → Threads (Users) → Thread Group. Thread Group will get added under the Test Plan (WebserviceTest) node. Next, let us modify the default properties of the Thread Group to suit our testing. Following properties are changed − Name − webservice user Number of Threads (Users) − 2 Ramp-Up Period − leave the the default value of 0 seconds. Loop Count − 2 Add Sampler – SOAP/XML-RPC Request Now that we have defined the users, it is time to define the tasks that they will be performing. We will add SOAP/XML-RPC Request element − Right-click mouse button to get the Add menu. Select Add → Sampler → SOAP/XML-RPC Request. Select the SOAP/XML-RPC Request element in the tree Edit the following properties as in the image below − The following details are entered in this element − Name − SOAP/XML-RPC Request URL − http://localhost:8080/hello/hello?wsdl Soap/XML-RPC Data − Enter the below contents <soapenv:Envelope xmlns:soapenv = “http://schemas.xmlsoap.org/soap/envelope/” xmlns:web = “http://ws.tutorialspoint.com/”> <soapenv:Header/> <soapenv:Body> <web:getHelloWorldMessage> <arg0>Manisha</arg0> </web:getHelloWorldMessage> </soapenv:Body> </soapenv:Envelope> Add Listener The final element you need to add to your Test Plan is a Listener. This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data. Select the webservice user element. Add a View Results Tree listener by selecting Add → Listener → View Results Tree. Run the Test Plan Now save the above test plan as test_webservice.jmx. Execute this test plan using Run → Start option. View the Output The following output can be seen in the listener. In the last image, you can see the response message “Hello Manisha to JAX WS world”. Print Page Previous Next Advertisements ”;

jMeter – Quick Guide

jMeter – Quick Guide ”; Previous Next jMeter – Overview Before going into the details of JMeter, let us first understand a few jargons associated with the testing of any application. Performance Test − This test sets the best possible performance expectation under a given configuration of infrastructure. It also highlights early in the testing process if any changes need to be made before the application goes into production. Load Test − This test is basically used for testing the system under the top load it was designed to operate under. Stress Test − This test is an attempt to break the system by overwhelming its resources. What is JMeter? JMeter is a software that can perform load test, performance-oriented business (functional) test, regression test, etc., on different protocols or technologies. Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it primarily to test the performance of Apache JServ (now called as Apache Tomcat project). Apache later redesigned JMeter to enhance the GUI and to add functional testing capabilities. JMeter is a Java desktop application with a graphical interface that uses the Swing graphical API. It can therefore run on any environment / workstation that accepts a Java virtual machine, for example − Windows, Linux, Mac, etc. The protocols supported by JMeter are − Web − HTTP, HTTPS sites ”web 1.0” web 2.0 (ajax, flex and flex-ws-amf) Web Services − SOAP / XML-RPC Database via JDBC drivers Directory − LDAP Messaging Oriented service via JMS Service − POP3, IMAP, SMTP FTP Service JMeter Features Following are some of the features of JMeter − Being an open source software, it is freely available. It has a simple and intuitive GUI. JMeter can conduct load and performance test for many different server types − Web – HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail – POP3, etc. It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on JMeter shell script. On Windows, it can be invoked by starting the jmeter.bat file. It has full Swing and lightweight component support (precompiled JAR uses packages javax.swing.* ). JMeter store its test plans in XML format. This means you can generate a test plan using a text editor. Its full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. It is highly extensible. It can also be used to perform automated and functional testing of the applications. How JMeter Works? JMeter simulates a group of users sending requests to a target server, and returns statistics that show the performance/functionality of the target server/application via tables, graphs, etc. Take a look at the following figure that depicts how JMeter works − jMeter – Environment JMeter is a framework for Java, so the very first requirement is to have JDK installed in your machine. System Requirement JDK 1.6 or above. Memory No minimum requirement. Disk Space No minimum requirement. Operating System No minimum requirement. Step 1: Verify Java Installation First of all, verify whether you have Java installed in your system. Open your console and execute one of the following java commands based on the operating system you are working on. OS Task Command Windows Open Command Console c:> java -version Linux Open Command Terminal $ java -version Mac Open Terminal machine: ~ joseph$ java -version If you have Java installed in your system, you would get an appropriate output based on the OS you are working on. OS Output Windows java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) Linux java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) Mac java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) If you do not have Java installed, install the Java Software Development Kit (SDK) from www.oracle.com/technetwork/java/javase/downloads/index.html. We are assuming Java 1.7.0_25 as the installed version for this tutorial. Step 2: Set Java Environment Set the JAVA_HOME environment variable to point to the base directory location, where Java is installed on your machine. For example − OS Output Windows Set the environment variable JAVA_HOME to C:Program FilesJavajdk1.7.0_25 Linux export JAVA_HOME=/usr/local/java-current Mac export JAVA_HOME=/Library/Java/Home Append Java compiler location to System Path. OS Output Windows Append the string; C:Program FilesJavajdk1.7.0_25bin to the end of the system variable, Path. Linux export PATH=$PATH:$JAVA_HOME/bin/ Mac not required Verify Java Installation using java -version command as explained above. Step 3: Download JMeter Download the latest version of JMeter from https://jmeter.apache.org/download_jmeter.cgi. For this tutorial, we downloaded apache-jmeter-2.9 and copied it into C:>JMeter folder. The directory structure should look like as shown below − apache-jmeter-2.9 apache-jmeter-2.9bin apache-jmeter-2.9docs apache-jmeter-2.9extras apache-jmeter-2.9lib apache-jmeter-2.9libext apache-jmeter-2.9libjunit apache-jmeter-2.9printable_docs You can rename the parent directory (i.e. apache-jmeter-2.9) if you want, but do not change any of the sub-directory names. Step 4: Run JMeter After downloading JMeter, go to the bin directory. In this case, it is /home/manisha/apache-jmeter-2.9/bin. Now click on the following − OS Output Windows jmeter.bat Linux jmeter.sh Mac jmeter.sh After a short pause, the JMeter GUI should appear, which is a Swing application, as seen in the following screenshot − This is the main page and the default page of the tool. jMeter – Build Test Plan What is a Test Plan? A Test Plan can be viewed as a container for running tests. It defines what to test and how to go about it. A complete test plan consists of one or more elements such as thread groups, logic controllers, sample-generating controllers, listeners, timers, assertions, and configuration elements. A test plan must have at least one thread group. Writing a Test Plan Follow the steps given below to write a test plan − Step 1: Start the JMeter Window Open the JMeter window by clicking /home/manisha/apache-jmeter-2.9/bin/jmeter.sh. The JMeter window will appear as below − This is a plain and blank JMeter window without any additional elements added to it.

jMeter – Useful Resources

jMeter – Useful Resources ”; Previous Next The following resources contain additional information on jMeter. Please use them to get more in-depth knowledge on this topic. Useful Video Courses Learn JMeter from Scratch on Live Apps – Performance Testing Most Popular 60 Lectures 9.5 hours Rahul Shetty More Detail JMeter Web Performance Testing Course 54 Lectures 13.5 hours Wallace Tauriac More Detail Jmeter Step By Step for Beginner to Advance 23 Lectures 1.5 hours Anuja Jain More Detail S/W Performance Testing With JMeter By Spotle.ai 12 Lectures 1 hours Spotle Learn More Detail Software Testing – Selenium, Postman And More By Spotle.ai 18 Lectures 2.5 hours Spotle Learn More Detail ChatGPT and More Software Testing Tools Every QA Should Know 1 Lectures 18 mins Andrii Kuchyrenko More Detail Print Page Previous Next Advertisements ”;

jMeter – Overview

jMeter – Overview ”; Previous Next Before going into the details of JMeter, let us first understand a few jargons associated with the testing of any application. Performance Test − This test sets the best possible performance expectation under a given configuration of infrastructure. It also highlights early in the testing process if any changes need to be made before the application goes into production. Load Test − This test is basically used for testing the system under the top load it was designed to operate under. Stress Test − This test is an attempt to break the system by overwhelming its resources. What is JMeter? JMeter is a software that can perform load test, performance-oriented business (functional) test, regression test, etc., on different protocols or technologies. Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it primarily to test the performance of Apache JServ (now called as Apache Tomcat project). Apache later redesigned JMeter to enhance the GUI and to add functional testing capabilities. JMeter is a Java desktop application with a graphical interface that uses the Swing graphical API. It can therefore run on any environment / workstation that accepts a Java virtual machine, for example − Windows, Linux, Mac, etc. The protocols supported by JMeter are − Web − HTTP, HTTPS sites ”web 1.0” web 2.0 (ajax, flex and flex-ws-amf) Web Services − SOAP / XML-RPC Database via JDBC drivers Directory − LDAP Messaging Oriented service via JMS Service − POP3, IMAP, SMTP FTP Service JMeter Features Following are some of the features of JMeter − Being an open source software, it is freely available. It has a simple and intuitive GUI. JMeter can conduct load and performance test for many different server types − Web – HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail – POP3, etc. It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on JMeter shell script. On Windows, it can be invoked by starting the jmeter.bat file. It has full Swing and lightweight component support (precompiled JAR uses packages javax.swing.* ). JMeter store its test plans in XML format. This means you can generate a test plan using a text editor. Its full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. It is highly extensible. It can also be used to perform automated and functional testing of the applications. How JMeter Works? JMeter simulates a group of users sending requests to a target server, and returns statistics that show the performance/functionality of the target server/application via tables, graphs, etc. Take a look at the following figure that depicts how JMeter works − Print Page Previous Next Advertisements ”;

jMeter – Build Test Plan

jMeter – Build Test Plan ”; Previous Next What is a Test Plan? A Test Plan can be viewed as a container for running tests. It defines what to test and how to go about it. A complete test plan consists of one or more elements such as thread groups, logic controllers, sample-generating controllers, listeners, timers, assertions, and configuration elements. A test plan must have at least one thread group. Writing a Test Plan Follow the steps given below to write a test plan − Step 1: Start the JMeter Window Open the JMeter window by clicking /home/manisha/apache-jmeter-2.9/bin/jmeter.sh. The JMeter window will appear as below − This is a plain and blank JMeter window without any additional elements added to it. It contains two nodes − Test Plan node − is where the real test plan is kept. Workbench node − It simply provides a place to temporarily store test elements while not in use, for copy/paste purposes. When you save your test plan, Workbench items are not saved with it. Step 2: Add/Remove Elements Elements (which will be discussed in the next chapter Test Plan Elements) can be added to a test plan by right-clicking on the Test Plan node and choosing a new element from the “add” list. Alternatively, you can load an element from a file and add it by choosing the “merge” or “open” option. For example, let us add a Thread Group element to a Test Plan as shown below − To remove an element, make sure the element is selected, right-click on the element, and choose the “remove” option. Step 3: Load and Save the Elements To load an element from file − Right-click on the existing tree element to which you want to add the loaded element. Select Merge. Choose the file where you saved the elements. JMeter will merge the elements into the tree. By default, JMeter does not save the element, you need to explicitly save it. To save tree elements − Right-click on the element. Choose the Save Selection As … option. 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. Step 4: Configuring the Tree Elements Any element in the Test Plan can be configured using the controls present in JMeter”s right-hand side frame. These controls allow you to configure the behavior of that particular test element. For example, the Thread Group can be configured for a number of users, ramp up periods, etc., as shown below − Step 5: Saving the Test Plan You can save an entire Test Plan by using either Save or “Save Test Plan As …” from the File menu. Step 6: Run the Test Plan You can run the Test Plan by clicking Start(Control + r) from the Run menu item. When JMeter starts running, it shows a small green box at the right-hand end of the section just under the menubar. The numbers to the left of the green box are the number of active threads / total number of threads. These only apply to a locally run test; they do not include any threads started on remote systems when using client-server mode. Step 7: Stop the Test Plan You can stop your test in two ways − Using Stop (Control + ”.”). It stops the threads immediately if possible. Using Shutdown (Control + ”,”). It requests the threads to stop at the end of any current work. Print Page Previous Next Advertisements ”;

jMeter – FTP Test Plan

jMeter – FTP Test Plan ”; Previous Next In this chapter, we will see how to test a FTP site using JMeter. Let us create a Test Plan to test the FTP site. Rename Test Plan Open the JMeter window by clicking /home/manisha/apache-jmeter-2.9/bin/jmeter.sh Click on the Test Plan node. Rename this Test Plan node as TestFTPSite. Add Thread Group Add one Thread Group, which is placeholder for all other elements like Samplers, Controllers, and Listeners. Right click on TestFTPSite (our Test Plan) Select Add → Threads(Users) → Thread Group. Thread Group will get added under the Test Plan (TestFTPSite) node. Modify the default properties of the Thread Group to suit our testing as follows − Name − FTPusers Number of Threads (Users) − 4 Ramp-Up Period − leave the the default value of 0 seconds. Loop Count − 1 Add Sampler − FTP Request Now that we have defined our users, it is time to define the tasks that they will be performing. Add FTP Request elements. We add two FTP request elements, one which retrieves a file and the other which puts a file on the ftp site. Select the FTP users element. Right-click the mouse button to get the Add menu Select Add → Sampler → FTP Request. Select the FTP Request element in the tree. Edit the following properties as shown below − The following details are entered in this element − Name − FTP Request Get Server Name or IP − 184.168.74.29 Remote File − /home/manisha/sample_ftp.txt Local File − sample_ftp.txt Select get(RETR) Username − manisha Password − manisha123 Now add another FTP request as above and edit the properties as shown in the following screenshot − The following details are entered in this element − Name − FTP Request Put Server Name or IP − 184.168.74.29 Remote File − /home/manisha/examplefile.txt Local File − /home/manisha/work/examplefile.txt Select put(STOR) Username − manisha Password − manisha123 Add Listener The final element you need to add to your Test Plan is a Listener. This element is responsible for storing all of the results of your FTP requests in a file and presenting a visual model of the data. Select the FTP users element. Add a View Results Tree listener by selecting Add > Listener > View Results Tree. Run the Test Plan Now save the above test plan as ftpsite_test.jmx. Execute this test plan using Run → Start option. View the Output The following output can be seen in the listener. You can see that four requests are made for each FTP request and the test is successful. The retrieved file for GET request is stored in the /bin folder. In our case, it is /home/manisha/apache-jmeter-2.9/bin/. For PUT request, the file is uploaded at the path /home/manisha/. Print Page Previous Next Advertisements ”;

jMeter – Environment

jMeter – Environment ”; Previous Next JMeter is a framework for Java, so the very first requirement is to have JDK installed in your machine. System Requirement JDK 1.6 or above. Memory No minimum requirement. Disk Space No minimum requirement. Operating System No minimum requirement. Step 1: Verify Java Installation First of all, verify whether you have Java installed in your system. Open your console and execute one of the following java commands based on the operating system you are working on. OS Task Command Windows Open Command Console c:> java -version Linux Open Command Terminal $ java -version Mac Open Terminal machine: ~ joseph$ java -version If you have Java installed in your system, you would get an appropriate output based on the OS you are working on. OS Output Windows java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) Linux java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) Mac java version “1.7.0_25” Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) If you do not have Java installed, install the Java Software Development Kit (SDK) from www.oracle.com/technetwork/java/javase/downloads/index.html. We are assuming Java 1.7.0_25 as the installed version for this tutorial. Step 2: Set Java Environment Set the JAVA_HOME environment variable to point to the base directory location, where Java is installed on your machine. For example − OS Output Windows Set the environment variable JAVA_HOME to C:Program FilesJavajdk1.7.0_25 Linux export JAVA_HOME=/usr/local/java-current Mac export JAVA_HOME=/Library/Java/Home Append Java compiler location to System Path. OS Output Windows Append the string; C:Program FilesJavajdk1.7.0_25bin to the end of the system variable, Path. Linux export PATH=$PATH:$JAVA_HOME/bin/ Mac not required Verify Java Installation using java -version command as explained above. Step 3: Download JMeter Download the latest version of JMeter from https://jmeter.apache.org/download_jmeter.cgi. For this tutorial, we downloaded apache-jmeter-2.9 and copied it into C:>JMeter folder. The directory structure should look like as shown below − apache-jmeter-2.9 apache-jmeter-2.9bin apache-jmeter-2.9docs apache-jmeter-2.9extras apache-jmeter-2.9lib apache-jmeter-2.9libext apache-jmeter-2.9libjunit apache-jmeter-2.9printable_docs You can rename the parent directory (i.e. apache-jmeter-2.9) if you want, but do not change any of the sub-directory names. Step 4: Run JMeter After downloading JMeter, go to the bin directory. In this case, it is /home/manisha/apache-jmeter-2.9/bin. Now click on the following − OS Output Windows jmeter.bat Linux jmeter.sh Mac jmeter.sh After a short pause, the JMeter GUI should appear, which is a Swing application, as seen in the following screenshot − This is the main page and the default page of the tool. Print Page Previous Next Advertisements ”;