Jmeter SOAP/REST Web Services Testing plan creation,in this lesson you will learn web services testing using Jmeter performance testing.Web Services is a client server application component using for communication between multiple systems or applications. Web Services transferring the data between different system with the help of Protocols example http protocols.In order to understand here i am using simple flight web services URL to create web services test plan in Jmeter. Let's create Web Services Test plan in jmeter.
Jmeter SOAP/REST Web Services Testing
Before creating web services test plan in jmeter we should require following details.
1.Web Service URL.
2.Web Service input parameters
3.Web Service Response details
1.Open Apache Jmeter from F:\apache-jmeter-3.0\bin folder by double click on jmeter.bat file in windows.
2.Right click on Test Plan Add - Threads - Thread Group,Enter following details
Number of Threads(Users):
Ramp up Period(in Seconds)
Loop Count
Thread Group
3.Right click on Thread Group - Add - Sampler - SOAP/XML-RPC Request,it will display below details
URL : Web Service url ex : http://localhost:24240/HPFlights_SOAP
Send SOAP Action
Soap/XML - RPC Data : This text area useful in writing SOAP input parameters in SOAP request as below.
4.Now add Response Assertion to verify the web services response,Right click on SOAP/XML-RPC Request - Add - Assertions - Response Assertion.
5.Click on Add in Pattern to Test and enter pattern to verify from Web Service Response as below.
Response Assertion - Pattern to Test
6.Add View Result Tree from Listeners, Right click on Thread Group - Add - Listeners - View Result Tree.
7.Save your script.
8.Now run your script and verify View Result Tree window whether it is pass or fail.
View Result Tree - PASS
View Result Tree - FAIL
What have you learn?
1.What is web services?
2.How to create web services test plan
3.How to add web services in jmeter
4.How to verify the web services response with assertions.
Apache JMeter is an open source performance tool which is helpful in testing load test for WebApplications and WebServices,REST API services.In latest JMeter 3.0 version apache software included Generate Jmeter Report Dashboard using APDEX(Application Performance Index).
How to Generate JMeter Report Dashboard
What is APDEX?
APDEX is an open standard which is developed by an alliance companies.APDEX which is useful in measure user satisfaction with the help of response time of applications and Services(WebServices/REST API).APDEX measures average time with the help of response time of application under test whether it could be web applications or WebServices.APDEX measure application response time with three levels,those are
Please don't create any CSV file file before running your Test Plan ,with the help of Simple Data Writer Test Result file automatically created in specified location.
Simple Data Writer Configuration:
Before Running your test plan we should configure below fields in Simple Data Writer window panel,those are
timeStamp
elapsed
label
responseCode
responseMessage
threadName
dataType
success
failureMessage
bytes
grpThreads
allThreads
Latency
IdleTime
Just click on Configure button in Simple Data Writer window panel then it will open Simple Result Save Configuration window then you have to select above checkboxes ,please see below screenshot.
Once everything is done just click on Done button and save your Test Plan script.
View Below Video for Better Understand
Jmeter Report Generation Configuration
In Apache jmeter 3.0 version it has given reportgeneration propertiesfile ,if you open that file it will display all report generation configuration details,simply copy thosejmeter.reportgenerator configuration in User Properties file as below.
Copy SAVE Service configurations also in User Properties file.
# Sets the satisfaction threshold for the APDEX calculation (in milliseconds).
jmeter.reportgenerator.apdex_satisfied_threshold=500
# Sets the tolerance threshold for the APDEX calculation (in milliseconds).
jmeter.reportgenerator.apdex_tolerated_threshold=1500
# Sets the size of the sliding window used by percentile evaluation.
# Caution : higher value provides a better accuracy but needs more memory.
#jmeter.reportgenerator.statistic_window = 200000
# Configure this property to change the report title
jmeter.reportgenerator.report_title=Apache JMeter Dashboard
# Defines the overall granularity for over time graphs
jmeter.reportgenerator.overall_granularity=60000
# Response Time Percentiles graph definition
jmeter.reportgenerator.graph.responseTimePercentiles.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesGraphConsumer
jmeter.reportgenerator.graph.responseTimePercentiles.title=Response Time Percentiles
# Response Time Distribution graph definition
jmeter.reportgenerator.graph.responseTimeDistribution.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeDistributionGraphConsumer
jmeter.reportgenerator.graph.responseTimeDistribution.title=Response Time Distribution
jmeter.reportgenerator.graph.responseTimeDistribution.property.set_granularity=500
# Active Threads Over Time graph definition
jmeter.reportgenerator.graph.activeThreadsOverTime.classname=org.apache.jmeter.report.processor.graph.impl.ActiveThreadsGraphConsumer
jmeter.reportgenerator.graph.activeThreadsOverTime.title=Active Threads Over Time
jmeter.reportgenerator.graph.activeThreadsOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Time VS Threads graph definition
jmeter.reportgenerator.graph.timeVsThreads.classname=org.apache.jmeter.report.processor.graph.impl.TimeVSThreadGraphConsumer
jmeter.reportgenerator.graph.timeVsThreads.title=Time VS Threads
# Bytes Throughput Over Time graph definition
jmeter.reportgenerator.graph.bytesThroughputOverTime.classname=org.apache.jmeter.report.processor.graph.impl.BytesThroughputGraphConsumer
jmeter.reportgenerator.graph.bytesThroughputOverTime.title=Bytes Throughput Over Time
jmeter.reportgenerator.graph.bytesThroughputOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Response Time Over Time graph definition
jmeter.reportgenerator.graph.responseTimesOverTime.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeOverTimeGraphConsumer
jmeter.reportgenerator.graph.responseTimesOverTime.title=Response Time Over Time
jmeter.reportgenerator.graph.responseTimesOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Latencies Over Time graph definition
jmeter.reportgenerator.graph.latenciesOverTime.classname=org.apache.jmeter.report.processor.graph.impl.LatencyOverTimeGraphConsumer
jmeter.reportgenerator.graph.latenciesOverTime.title=Latencies Over Time
jmeter.reportgenerator.graph.latenciesOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Response Time Vs Request graph definition
jmeter.reportgenerator.graph.responseTimeVsRequest.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer
jmeter.reportgenerator.graph.responseTimeVsRequest.title=Response Time Vs Request
jmeter.reportgenerator.graph.responseTimeVsRequest.exclude_controllers=true
jmeter.reportgenerator.graph.responseTimeVsRequest.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Latencies Vs Request graph definition
jmeter.reportgenerator.graph.latencyVsRequest.classname=org.apache.jmeter.report.processor.graph.impl.LatencyVSRequestGraphConsumer
jmeter.reportgenerator.graph.latencyVsRequest.title=Latencies Vs Request
jmeter.reportgenerator.graph.latencyVsRequest.exclude_controllers=true
jmeter.reportgenerator.graph.latencyVsRequest.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Hits Per Second graph definition
jmeter.reportgenerator.graph.hitsPerSecond.classname=org.apache.jmeter.report.processor.graph.impl.HitsPerSecondGraphConsumer
jmeter.reportgenerator.graph.hitsPerSecond.title=Hits Per Second
jmeter.reportgenerator.graph.hitsPerSecond.exclude_controllers=true
jmeter.reportgenerator.graph.hitsPerSecond.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Codes Per Second graph definition
jmeter.reportgenerator.graph.codesPerSecond.classname=org.apache.jmeter.report.processor.graph.impl.CodesPerSecondGraphConsumer
jmeter.reportgenerator.graph.codesPerSecond.title=Codes Per Second
jmeter.reportgenerator.graph.codesPerSecond.exclude_controllers=true
jmeter.reportgenerator.graph.codesPerSecond.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# Transactions Per Second graph definition
jmeter.reportgenerator.graph.transactionsPerSecond.classname=org.apache.jmeter.report.processor.graph.impl.TransactionsPerSecondGraphConsumer
jmeter.reportgenerator.graph.transactionsPerSecond.title=Transactions Per Second
jmeter.reportgenerator.graph.transactionsPerSecond.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
# HTML Export
jmeter.reportgenerator.exporter.html.classname=org.apache.jmeter.report.dashboard.HtmlTemplateExporter
# Sets the destination directory for generated html pages.
# This will be overridden by the command line option -o
jmeter.reportgenerator.exporter.html.property.output_dir=/tmp/test-report
#------------------------------------------------------
#SAVE SERVICE Configurations
#---------------------------------------------------------
jmeter.save.saveservice.bytes = true
jmeter.save.saveservice.label = true
jmeter.save.saveservice.latency = true
jmeter.save.saveservice.response_code = true
jmeter.save.saveservice.response_message = true
jmeter.save.saveservice.successful = true
jmeter.save.saveservice.thread_counts = true
jmeter.save.saveservice.thread_name = true
jmeter.save.saveservice.time = true
jmeter.save.saveservice.print_field_names=true
# the timestamp format must include the time and should include the date.
# For example the default, which is milliseconds since the epoch:
#jmeter.save.saveservice.timestamp_format = ms
# Or the following would also be suitable
jmeter.save.saveservice.timestamp_format = dd/MM/yyyy HH:mm
#save service assertion
jmeter.save.saveservice.assertion_results_failure_message = true
Test Results - CSV file:
Before Generating the script ,run your Test Plan as specified time interval and once all threads are completed then simple data Writer generates Test Results file as specified location as below screenshot.Now run Test plan up-to 300 seconds i.e 5 Minutes,results file will generate from Simple Data Writer ,here i am saving test result file in CSV file.
Now open Command Prompt.
Go to ApacheJmeter3.0/bin path as below
Enter below command to generate the reports as per test results csv file.
Press Enter ,it will display in case any errors present in generated CSV file other wise it will generate Apache Jmeter Report Dashboard in specified folder.
Go to HTMLReports folder and it will display below folders and index.html file
Content
sbadmin2-1.0.7
index.html
README
Now open index.html in chrome browser and it will display Apache Report Dashboard as below.
Please provide your valuable comments and suggestions on this post.