We all know that the word “Automation ” means, there should not be any human intervention for the task.While entering towards the Performance Analysis the most challenging part of the performance testing process is the analysis of test results and the identification of bottlenecks. Similarly w.r.t Jmeter we can achieve this by integrating with the ant build process.
While I approach JMETER for the Performance Evaluation ,Usually I go with the LISTENER “RESULT TREE ” ,for identifying the Breakpoint/Error Result .For an accurate report,in terms of Analysis , I understood a more elaborate way will be a bit easy.
SAMPLE SCENARIO :
After a long header,For identifying the break point of site ,I found out ANT is an easy OPEN SOURCE WAY ..Ant is a Java-based build tool created as part of the Apache open-source project.They have a structure and are written in XMl
Performance in terms of “Maximum user affordability“
Prerequisites :
1)Install java 1.6 version (check the existence of jre and jdk folders with the version 1.6 properly )
Set the environment variable ( Start >> Control panel >>System >> Advance system settings >>Environment variable >> Set PATH )
2)Install ANT inside any drive .
a. Download ANT http://ant.apache.org/
b. Unzip it and rename to ant.
c. Set environmental variable JAVA_HOME to your JAVA ENVIRONMENT.
Set the environmental variable (Start >> Control panel >>System>>Advance system settings >>Environment variable >> Set PATH )
Give the Variable Name:ANT_HOME
Give the Value: E:\ant
Click OK
Then,we’ll add new ANT_HOME path,
And Click again on New Button if you do not have ‘path’ Variable in there, if so select it and edit as
Give the Variable Name:path
Give the Value D:\Program Files\Java\jdk1.6.0_03\bin;%ANT_HOME%\bin
Click OK
d. Check whether ANT works correctly or not using the following command in command prompt.
ant -version
3)Install Jmeter 2.6 (versions if any,try to install the versions less than 2.7 ).
Add “ant-Jmeter 1.11” jar file inside the jmeter ( Jmeter>> extras folder ).
Steps to proceed :
1)Run the script in bad boy for recording the script.
2) Export to Jmeter as jmx file in Extras folder
3)Execute Jmeter bat/windows file ,Launch jmeter through command prompt,and save result .
4)Open the xml file inside Jmeter>> Extras folder .
Open it and edit the following lines
a) Jmeter home (1) : Here specify the Jmeter saved location
b) Test plan (2): The name of the exported Jmeter file ( .jmx file )
c) Result log (3): The file to which the results should get logged ( system will create its own (same name of the jmx file ,save in (.jtl file ))
d)In (4): The name of the file (same file of result log(c) )
e)Out (5) : The html file to which the result is logged,where we can Analyse /Review result .
check the screen shot for the reference points (1,2,3,4,5).
5)Save the xml file
6) Open the command prompt and go to the Jmeter /bin location .
Run the jmeter -n -t ..\extras\name.jmx -l name.jtl.
Defines the number of threads (n) and time segments (t) .. mentions the location of the file from which its running .
the (l) mentions the result log file to which it gets logged.
7)Now Navigate to the ant-jmeter location through command prompt ,for the xml file running
as :C:\Program Files\apache\apache-jmeter-2.11\extras>ant
Run the file ,build the tree ,result are logged to jtl as well as html ,and shows the message as ” build successful. “
Goto the extras folder and check the html file created with the same name of the jmx file .
Open it and check the results ..
For overwrite the sample run report ,
Goto the xml file ,edit the following line above Jmeter definition .
delete file =”${testpath}/ ${name of the file to get overwrite}.html “.
Thus the performance report is in your hand now ..