Tuesday 15 December 2020

JMeter Performance Test of Application

 Case Study - 01

------------------

Performance Testing of application 

Case 1

      1-> With 5 users, all users are hitting server at same time.

      2-> User are visiting 3 pages

      3-> Before going to each of the page, we need to have some waiting time.

      4-> My URL could be change in future(Keep in mind)

      5-> Generated tabular and graph as well


---------------------------

solution using jmeter -

<?xml version="1.0" encoding="UTF-8"?>

<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.3">

  <hashTree>

    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">

      <stringProp name="TestPlan.comments"></stringProp>

      <boolProp name="TestPlan.functional_mode">false</boolProp>

      <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>

      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>

      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">

        <collectionProp name="Arguments.arguments"/>

      </elementProp>

      <stringProp name="TestPlan.user_define_classpath"></stringProp>

    </TestPlan>

    <hashTree>

      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TestCase1" enabled="true">

        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>

        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">

          <boolProp name="LoopController.continue_forever">false</boolProp>

          <stringProp name="LoopController.loops">1</stringProp>

        </elementProp>

        <stringProp name="ThreadGroup.num_threads">5</stringProp>

        <stringProp name="ThreadGroup.ramp_time">1</stringProp>

        <boolProp name="ThreadGroup.scheduler">false</boolProp>

        <stringProp name="ThreadGroup.duration"></stringProp>

        <stringProp name="ThreadGroup.delay"></stringProp>

        <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>

      </ThreadGroup>

      <hashTree>

        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Req1" enabled="true">

          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">

            <collectionProp name="Arguments.arguments"/>

          </elementProp>

          <stringProp name="HTTPSampler.domain"></stringProp>

          <stringProp name="HTTPSampler.port"></stringProp>

          <stringProp name="HTTPSampler.protocol">https</stringProp>

          <stringProp name="HTTPSampler.contentEncoding"></stringProp>

          <stringProp name="HTTPSampler.path">/</stringProp>

          <stringProp name="HTTPSampler.method">GET</stringProp>

          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>

          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>

          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>

          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>

          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>

          <stringProp name="HTTPSampler.connect_timeout"></stringProp>

          <stringProp name="HTTPSampler.response_timeout"></stringProp>

        </HTTPSamplerProxy>

        <hashTree/>

        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Req2" enabled="true">

          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">

            <collectionProp name="Arguments.arguments"/>

          </elementProp>

          <stringProp name="HTTPSampler.domain"></stringProp>

          <stringProp name="HTTPSampler.port"></stringProp>

          <stringProp name="HTTPSampler.protocol">https</stringProp>

          <stringProp name="HTTPSampler.contentEncoding"></stringProp>

          <stringProp name="HTTPSampler.path">/soap-web-services-api/</stringProp>

          <stringProp name="HTTPSampler.method">GET</stringProp>

          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>

          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>

          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>

          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>

          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>

          <stringProp name="HTTPSampler.connect_timeout"></stringProp>

          <stringProp name="HTTPSampler.response_timeout"></stringProp>

        </HTTPSamplerProxy>

        <hashTree>

          <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">

            <stringProp name="ConstantTimer.delay">3000</stringProp>

          </ConstantTimer>

          <hashTree/>

        </hashTree>

        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Req3" enabled="true">

          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">

            <collectionProp name="Arguments.arguments"/>

          </elementProp>

          <stringProp name="HTTPSampler.domain"></stringProp>

          <stringProp name="HTTPSampler.port"></stringProp>

          <stringProp name="HTTPSampler.protocol">https</stringProp>

          <stringProp name="HTTPSampler.contentEncoding"></stringProp>

          <stringProp name="HTTPSampler.path">/docker/</stringProp>

          <stringProp name="HTTPSampler.method">GET</stringProp>

          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>

          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>

          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>

          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>

          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>

          <stringProp name="HTTPSampler.connect_timeout"></stringProp>

          <stringProp name="HTTPSampler.response_timeout"></stringProp>

        </HTTPSamplerProxy>

        <hashTree>

          <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">

            <stringProp name="ConstantTimer.delay">3000</stringProp>

          </ConstantTimer>

          <hashTree/>

        </hashTree>

        <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">

          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">

            <collectionProp name="Arguments.arguments"/>

          </elementProp>

          <stringProp name="HTTPSampler.domain">automationstepbystep.com</stringProp>

          <stringProp name="HTTPSampler.port"></stringProp>

          <stringProp name="HTTPSampler.protocol">https</stringProp>

          <stringProp name="HTTPSampler.contentEncoding"></stringProp>

          <stringProp name="HTTPSampler.path"></stringProp>

          <stringProp name="HTTPSampler.concurrentPool">6</stringProp>

          <stringProp name="HTTPSampler.connect_timeout"></stringProp>

          <stringProp name="HTTPSampler.response_timeout"></stringProp>

        </ConfigTestElement>

        <hashTree/>

        <ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">

          <boolProp name="ResultCollector.error_logging">false</boolProp>

          <objProp>

            <name>saveConfig</name>

            <value class="SampleSaveConfiguration">

              <time>true</time>

              <latency>true</latency>

              <timestamp>true</timestamp>

              <success>true</success>

              <label>true</label>

              <code>true</code>

              <message>true</message>

              <threadName>true</threadName>

              <dataType>true</dataType>

              <encoding>false</encoding>

              <assertions>true</assertions>

              <subresults>true</subresults>

              <responseData>false</responseData>

              <samplerData>false</samplerData>

              <xml>false</xml>

              <fieldNames>true</fieldNames>

              <responseHeaders>false</responseHeaders>

              <requestHeaders>false</requestHeaders>

              <responseDataOnError>false</responseDataOnError>

              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>

              <assertionsResultsToSave>0</assertionsResultsToSave>

              <bytes>true</bytes>

              <sentBytes>true</sentBytes>

              <url>true</url>

              <threadCounts>true</threadCounts>

              <idleTime>true</idleTime>

              <connectTime>true</connectTime>

            </value>

          </objProp>

          <stringProp name="filename"></stringProp>

        </ResultCollector>

        <hashTree/>

        <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">

          <boolProp name="ResultCollector.error_logging">false</boolProp>

          <objProp>

            <name>saveConfig</name>

            <value class="SampleSaveConfiguration">

              <time>true</time>

              <latency>true</latency>

              <timestamp>true</timestamp>

              <success>true</success>

              <label>true</label>

              <code>true</code>

              <message>true</message>

              <threadName>true</threadName>

              <dataType>true</dataType>

              <encoding>false</encoding>

              <assertions>true</assertions>

              <subresults>true</subresults>

              <responseData>false</responseData>

              <samplerData>false</samplerData>

              <xml>false</xml>

              <fieldNames>true</fieldNames>

              <responseHeaders>false</responseHeaders>

              <requestHeaders>false</requestHeaders>

              <responseDataOnError>false</responseDataOnError>

              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>

              <assertionsResultsToSave>0</assertionsResultsToSave>

              <bytes>true</bytes>

              <sentBytes>true</sentBytes>

              <url>true</url>

              <threadCounts>true</threadCounts>

              <idleTime>true</idleTime>

              <connectTime>true</connectTime>

            </value>

          </objProp>

          <stringProp name="filename"></stringProp>

        </ResultCollector>

        <hashTree/>

        <ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="true">

          <boolProp name="ResultCollector.error_logging">false</boolProp>

          <objProp>

            <name>saveConfig</name>

            <value class="SampleSaveConfiguration">

              <time>true</time>

              <latency>true</latency>

              <timestamp>true</timestamp>

              <success>true</success>

              <label>true</label>

              <code>true</code>

              <message>true</message>

              <threadName>true</threadName>

              <dataType>true</dataType>

              <encoding>false</encoding>

              <assertions>true</assertions>

              <subresults>true</subresults>

              <responseData>false</responseData>

              <samplerData>false</samplerData>

              <xml>false</xml>

              <fieldNames>true</fieldNames>

              <responseHeaders>false</responseHeaders>

              <requestHeaders>false</requestHeaders>

              <responseDataOnError>false</responseDataOnError>

              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>

              <assertionsResultsToSave>0</assertionsResultsToSave>

              <bytes>true</bytes>

              <sentBytes>true</sentBytes>

              <url>true</url>

              <threadCounts>true</threadCounts>

              <idleTime>true</idleTime>

              <connectTime>true</connectTime>

            </value>

          </objProp>

          <stringProp name="filename"></stringProp>

        </ResultCollector>

        <hashTree/>

        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">

          <boolProp name="ResultCollector.error_logging">false</boolProp>

          <objProp>

            <name>saveConfig</name>

            <value class="SampleSaveConfiguration">

              <time>true</time>

              <latency>true</latency>

              <timestamp>true</timestamp>

              <success>true</success>

              <label>true</label>

              <code>true</code>

              <message>true</message>

              <threadName>true</threadName>

              <dataType>true</dataType>

              <encoding>false</encoding>

              <assertions>true</assertions>

              <subresults>true</subresults>

              <responseData>false</responseData>

              <samplerData>false</samplerData>

              <xml>false</xml>

              <fieldNames>true</fieldNames>

              <responseHeaders>false</responseHeaders>

              <requestHeaders>false</requestHeaders>

              <responseDataOnError>false</responseDataOnError>

              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>

              <assertionsResultsToSave>0</assertionsResultsToSave>

              <bytes>true</bytes>

              <sentBytes>true</sentBytes>

              <url>true</url>

              <threadCounts>true</threadCounts>

              <idleTime>true</idleTime>

              <connectTime>true</connectTime>

            </value>

          </objProp>

          <stringProp name="filename"></stringProp>

        </ResultCollector>

        <hashTree/>

      </hashTree>

    </hashTree>

  </hashTree>

</jmeterTestPlan>


No comments:

Post a Comment