Let us now consider the "Weather India" application. It is a web-based application, which accesses data from the table called "cityweather" of "weafher.mdb" (MS Access file). We will demonstrate how to use Apache JMeter to test the performance of the database server (.mdb file), when multiple users try to access the database simultaneously.
The first step is to create a JDBC Test Plan. The test plan includes the following sections:
Creating the Thread Group
When you initially start the JMeter application, it displays the dialog shown in Figure. By default, the tree structure contains two elements: Test Plan and Work Bench.
Step 2: To create a Thread Group, right click on the "Test Plan" and select Add-> Thread Group as shown in Figure.
The Thread Group has to be created under the "Test Plan" section.
Step 3: On adding the "Thread Group", it displays the "Thread Group" details on the right side of the window as shown in Fig. 8.3, which prompts you to enter all the details related to the Thread Group, such as
Enter the Thread Group name as "Weather Jdbc Users", Number of Threads to be created as 10 and uncheck the "Forever" checkbox and enter the "Loop Count" as 3 as shown in Figure.
Step 4: After entering all the details, click the "Add" button, the newly created Thread Group will be added to the Tree under the "Test Plan" section.
Creating the JDBC Requests
Now add the various requests to be made, to the Thread Group we just created.
Step 1: Select the "Weather Jdbc Users" Thread Group from the tree structure. Right click on it to add the JDBC Request as shown in Figure.
Add -» Sampler ->JDBC Request
Step 2: When you select the "JDBC Request" option, it displays the "JDBC Request" details at the right side work area as shown in Figure.
Similarly create some more JDBC Requests, which retrieve the weather information of some more cities like "Pune", "Jaipur", "Chennai" etc. by providing the corresponding query strings.
Adding Listeners that Display the Result
This helps you to view the results and to store the results in a file. To add listeners follow the steps given below:
Step 1: Select the "Weather Jdbc Users" Thread Group. Right click on it and add the "Listener" as shown in Figure.
Add -> Listener -> Graph Results
Step 2: On selecting this option, the "Graph Results" section will be added to the "Weather Jdbc Users" Thread Group. Enter the name of the Listener as "Weather Graph Results".
Saving the Test Plan
To Save the Test Plan File -> Save
It will display the Save Dialog box, enter a File name and click on Save button.
Running the Test Plan
To Run the Test plan
Run -> Start
The "Start" option of "Run" menu will now be disabled and the "Stop" option will be enabled. If the small square on the upper-right hand of the "Graph Results" dialog is in green color, it indicates that the application is in "Running" Mode as shown in Figure.
If you stop the execution in between by selecting the "Stop" option from the "Run" menu, then it displays the message shown in Figure.
Displays the results that are generated by the Graph Listener after executing the requests.
Inserting the Tinier
JMeter,by default, does not pause between the requests. But it is recommended to put some time-interval before processing the next request. Timer is used to specify the delay between each request.
Till now we have tested the application without introducing any delay between the requests. We now introduce some delay and perform the tests again. There are 4 types of timers. We will make use of the "Constant Timer".
To insert the timer into the test plan, the procedure is as follows:
Step 1: Insert the Timer as shown in Figure.
The "Constant Timer" waits for the specified amount of time before processing the next request.
Step 2: On selecting "Constant Timer", the dialog shown in Figure is displayed.
Enter the name of the Timer as "Weather Constant Timer" and the delay time as 300 milliseconds as shown in Figure.
Step 3: Before running the test plan, clear the previous test results.
Step 4: Run the test plan: Select the "Weather Graph Results" element from the tree, run the test plan using Start option in Run menu (Run -^ Start) and examine the test results as shown in Figure.
Testing Tools Related Interview Questions
|LoadRunner Interview Questions||QTP Interview Questions|
|Agile Testing Interview Questions||Manual Testing Interview Questions|
|Quality Management Interview Questions||Quality Control Interview Questions|
|Selenium Interview Questions||Qlik View Interview Questions|
|Bugzilla Bug Tracking System Interview Questions||Software testing Interview Questions|
|Test Cases Interview Questions||Performance Testing Interview Questions|
|Test Estimation Interview Questions||Test Manager Interview Questions|
|Qlik Sense Interview Questions||Test Director Interview Questions|
|Mantis Bug Tracking Interview Questions||Test Plan Interview Questions|
|Defect Reporting Interview Questions||Test Complete Interview Questions|
Testing Tools Related Practice Tests
|LoadRunner Practice Tests||QTP Practice Tests|
|Agile Testing Practice Tests||Manual Testing Practice Tests|
|Quality Management Practice Tests||Quality Control Practice Tests|
|Selenium Practice Tests||Qlik View Practice Tests|
|Bugzilla Bug Tracking System Practice Tests||Software testing Practice Tests|
|Performance Testing Practice Tests|
Testing Tools Tutorial
Software Qualityassurance An Overview
Software Testing Process
Software Testing Tools An Overview
Source Code Testing Utilities In Unix/linux Environment
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.