<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mousume Haque on Medium]]></title>
        <description><![CDATA[Stories by Mousume Haque on Medium]]></description>
        <link>https://medium.com/@haquemousume?source=rss-451b0a2cf1f3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*G7bmawSVCdG98Mt3VVjjOg.jpeg</url>
            <title>Stories by Mousume Haque on Medium</title>
            <link>https://medium.com/@haquemousume?source=rss-451b0a2cf1f3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:56:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@haquemousume/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JMeter Authorization with dynamic access token(Bearer) and generate test data dynamically]]></title>
            <link>https://haquemousume.medium.com/jmeter-authorization-with-dynamic-access-token-bearer-and-generate-test-data-dynamically-83aa6df2ce56?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/83aa6df2ce56</guid>
            <category><![CDATA[dynamicaccesstoken]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[loadtest]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 16:26:46 GMT</pubDate>
            <atom:updated>2020-09-27T16:26:46.207Z</atom:updated>
            <content:encoded><![CDATA[<p>Authorization with dynamic access token is used to pass the dynamic response content to the subsequent requests which can be further used in APIs to validate the authenticity.</p><p>For example, these days applications generate an access token in response to a valid login request and further use it in all the subsequent request(s) to check the authorization of users.</p><p>In this article we’re going to set up a quick prototype for handling Token-based authentication with our favorite load testing tool — JMeter.</p><p>If you already have your Postman Collection in your hand can simply convert it through<strong> Loadium</strong> otherwise follow the below steps one by one.</p><p>Link: <a href="https://loadium.com/postman-to-jmeter-converter/"><strong>https://loadium.com/postman-to-jmeter-converter/</strong></a></p><ul><li>A Test Plan (<em>this should be present by default when opening JMeter</em>)</li><li>A Thread Group</li><li>View Results Tree</li><li>HTTP Request — <em>for authentication</em></li><li>JSON Extractor — <em>to extract the token</em></li><li>HTTP Header Manager — <em>to append the token for subsequent requests</em></li><li>HTTP Request — <em>the actual request to be tested</em></li></ul><p>I have already my Postman collection so I converted it into Jmeter (.jmx) file and got the following screen(Test Plan) when I opened the .jmx file in Jmeter.</p><ol><li><strong>Test Plan (Jmeter_IAM):</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-N9GNiO666WMr05O-kA_qg.png" /><figcaption>Fig 1 : User Defined Variables are added in the Test Plan</figcaption></figure><p>In the above screen, Jmeter_IAM is the Test Plan, Http URL/API Test is the Thread Group, Http Cookie Manager is added by default by the Loadium converter, Connect _Token is the 1st HTTP Request — <em>for authentication </em>and<em> </em>Create_User is the 2nd HTTP Request — <em>the actual request to be tested.</em> Finally I have added some user defined variables which are needed to run the script.</p><p><strong>2. Http Request(Connect_Token):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SKiukAr4BP-edqNr-LuQyA.png" /><figcaption>Fig 2 : Http Request( Connect_Token) with parameters</figcaption></figure><p>Through the <strong>Connect_Token</strong> HTTP Request we send our initial authentication request to the server which accepts some parameters (for example: Client_id, grant_type etc.) and generates an access token in response, which could be used later in subsequent authorization requests.</p><p><strong>3. Create a listener ‘View Results Tree’:</strong></p><p><em>TIP: Right click Test Plan(Jmeter_IAM) &gt; Add &gt; Listener &gt; View Results Tree</em></p><p>Now run the script and you will get the following result in tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ejWH_mY6FKTy1XehWHs7g.png" /><figcaption>Fig 3 : View Result Tree: Connect_Token</figcaption></figure><p>Here we can see that we already got the<strong> access_token</strong> from <strong>Connect_Token </strong>request and <strong>Create_User</strong> request failed because we didn’t add the <strong>access_token</strong> authentication yet in <strong>Create_User</strong> request.</p><p><strong>4. Add ‘JSON Extractor’ under ‘Connect_Token’ Request:</strong></p><p><em>TIP: Right click HTTP Request(Connect_Token) &gt; Add &gt; Post Processors &gt; JSON Extractor</em></p><p>This is the most important step. We will use it to fetch dynamic access token from the response of <strong>Connect_Token</strong> Request. See the below screenshot-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vukXhV3zsnE0zm8D-VULcA.png" /><figcaption>Fig 4 : JSON Extractor to fetch dynamic access token</figcaption></figure><p>We will have to set following parameters for ‘<strong>JSON Extractor</strong>’:</p><p><strong>a) <em>Names of created variables:</em> </strong>Name of the variable in which the extracted value will be stored. In our example, it is<strong> auth_token</strong>.</p><p><strong>b) <em>JSON path expressions: </em></strong>Here I have used <strong>$.access_token </strong>(expression stats with $ symbol)<strong> </strong>because from <strong>View Result Tree screenshot</strong> (Refer to Fig#3) I can see <strong>access_token</strong> is a 1st level element so I put single dot and element name is <strong>access_token, </strong>if it was a 2nd level element then I have to put two dots Ex:<strong> $..access_token</strong></p><p><strong>c) <em>Match No.(0 for Random):</em></strong> Tells which match should be picked. 0 is used for random. As there is only one <strong>access_token</strong> in JSON response so it should be 1.</p><p><strong>d) <em>Default Values:</em></strong> In case of no match which value should be picked. Here I gave <strong>TokenNotFound</strong>. If <strong>access_token</strong> is not found then variable <strong>auth_token</strong> will the hold the value <strong>TokenNotFound.</strong></p><p><strong>5. Add ‘Debug Sampler’ to verify whether value is stored in variable auth_token:</strong></p><p><em>TIP: Right click Thread Group(Http URL/API Test) &gt; Add &gt; Sampler&gt; Debug Sampler</em></p><p>Debug Sampler which is the best way to troubleshoot script variable. Now run the script and from View Results Tree you can see that <strong>access_token</strong> value is stored in <strong>auth_token</strong> variable successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qk5njukQO26JqlNonCCugA.png" /><figcaption>Fig 5 : Debug Sampler</figcaption></figure><p><strong>6. Add ‘HTTP Header Manager’ under ‘Create_User’ request:</strong></p><p><em>TIP: Right click HTTP Request(Create_User) &gt; Add &gt; Config Element&gt; HTTP Header Manager</em></p><p>Here<strong> Create_user </strong>HTTP Request is the subsequent requests which requires access token in the authorization request.</p><p>Add <strong>HTTP Header Manager</strong> under <strong>Create_user</strong> request. This is the second most important step. Generally, for applications, it includes all the header requests which should be passed with the HTTP Request. Most importantly we have to pass the token as a Header something like this: <strong>Bearer ${auth_token}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvrzOguXx-rc-3QNN0CJcA.png" /><figcaption>Fig 6 : Passing the Authorization Bearer token through HTTP Header Manager</figcaption></figure><p><strong>7. Add </strong>‘<strong>BeanShell PreProcessor</strong>’ <strong>under ‘Create_User’ request:</strong></p><p><em>TIP: Right click HTTP Request(Create_User) &gt; Add &gt; Post Processors&gt; BeanShell PreProcessor</em></p><p>Remember when setting up <strong>JSON Extractor</strong> earlier, we used Names of created variables as <strong>auth_token</strong>? Refer to point #4. It is being used here.</p><p>Add below code in the script section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvDGm61hLKIVrqJKH_ZDLg.png" /><figcaption>Fig 7 : Code need to write in script section</figcaption></figure><p>The script that is mentioned in this step, will pass the <strong>auth_token</strong> value in the Authorization Header for <strong>Create_User</strong> Request. See the following screenshot-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O80RU-fHHlHqkOXzvQrslQ.png" /><figcaption>Fig 8 : BeanShell PreProcessor script</figcaption></figure><p><strong>8. Use some built-in JMeter random functions and variables to generate dynamic data while creating user:</strong></p><p>Here I have used:</p><p><strong>${__UUID()}</strong> for creating dynamic<strong> externalId</strong>, <strong>${__RandomString(11,123456789)}</strong> for creating dynamic <strong>phoneNumber</strong>,</p><p><strong>${__RandomString(20,abcyutrd@</strong><a href="/service/mailto:fghjk@test.com"><strong>fghjk@test.com</strong></a><strong>)}</strong> for creating dynamic <strong>email</strong></p><p>for executing uninterrupted load test as these field must be unique while creating user.</p><p>You can read more about JMeter Functions and Variables <a href="https://jmeter.apache.org/usermanual/functions.html?fbclid=IwAR2783zFRqxdDFOyFiCEplZ9LmCRcrzp6J3IAwtZ3gDdNx8pfq5mT3abG6g#__RandomString">here.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bELAkEF1MplwfexYb3qZHg.png" /><figcaption>Fig 9 : Using Random function and variables</figcaption></figure><p><strong>9. Now run the script and see the result in View Results Tree:</strong></p><p>Here all we can see that both request is successful and from <strong>Create_User </strong>Request tab we can verify that <strong>Authorization</strong> header has the value <strong>BEARER + access_token</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WE9_I6iz1rXSeAcF06ZFWw.png" /><figcaption>Fig 10 : Create_User request is successful with proper authorization</figcaption></figure><p>We can use ‘<strong>JSON Extractor</strong>’ to capture any dynamic data from the response and then it can be sent to subsequent requests using <strong>‘BeanShell PreProcessor’</strong>. This approach makes it very simple to test APIs in which we need to get authentication token from the server and then passing it on all other requests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83aa6df2ce56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Socket Load Test]]></title>
            <link>https://haquemousume.medium.com/socket-load-test-4f24d2a2f6d9?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f24d2a2f6d9</guid>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[sockets]]></category>
            <category><![CDATA[artillery]]></category>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Thu, 23 Apr 2020 13:50:39 GMT</pubDate>
            <atom:updated>2024-10-30T10:55:09.898Z</atom:updated>
            <content:encoded><![CDATA[<h3>Socket Load Testing</h3><p>There are many stable open source load/performance testing tools like JMeter, Apache Bench, Artillery and so on in the internet right now. Here I am just sharing my professional experience from my work space.</p><p>As our websocket is not the traditional one and we use Socket.io which is basically a library that enables real-time, bidirectional and event-based communication between the browser and the server. So, Here we will use Artillery as it includes socket.io as well as regular websocket servers.</p><p><strong>Artillery:</strong></p><p>Artillery is an advanced, powerful &amp; easy-to-use load testing and functional testing toolkit. Use it to ship scalable applications that stay performant &amp; resilient under high load. It supports various reports from latency to concurrent users.</p><p><strong>Installing Artillery:</strong></p><p><strong>Step 1:</strong> Artillery is written in Node.js. So, need to install node.js</p><p>Official site: <a href="https://www.youtube.com/redirect?q=https%3A%2F%2Fnodejs.org%2Fen%2Fdownload%2F&amp;redir_token=MdUSsRqoEt159uXE3ZZxrJbEPCl8MTU3NDQyMDAwM0AxNTc0MzMzNjAz&amp;event=video_description&amp;v=f2yMmOGZU7M">https://nodejs.org/en/download/</a></p><p>Now check, whether node.js is installed properly or not</p><p>a. Open cmd/PowerShell from your machine</p><p>b. Type: <strong>node -v</strong></p><p>And you will see the version of node.</p><p>c. You can also try with: <strong>npm -v</strong></p><p>And you will get the version of npm.</p><p><strong>Step 2: </strong>Now install <strong>Artillery</strong> using either <strong>npm</strong> or <strong>yarn.</strong></p><p># Via npm</p><p><strong>Type: npm install -g artillery</strong></p><p># Via Yarn</p><p><strong>Type: yarn global add artillery</strong></p><p><strong>Step 3: </strong>To check if it is installed correctly or not</p><p>Type: <strong>artillery — — version</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*x5qtGIy4OAm67bC9rdEEJA.png" /><figcaption>Artillery Version Check</figcaption></figure><p><strong>Design Test Scenario:</strong></p><p>Firstly, it is essential to design your load test scenario, before trying to config any load tester to test your service.</p><p>I prefer to divide my load test scenario into 3 phases:</p><ul><li><strong>Phase 0:</strong> Warming up the web socket service with a short and light. load.</li><li><strong>Phase 1:</strong> Ramping up the previous load and trying to achieve the target load with the capacity of the service, OS, and hardware.</li><li><strong>Phase 2: </strong>Maximize the load beyond the target.</li></ul><p>Artillerry.io test profiles are in YAML format. I start to create my test scenario profile in the YAML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*1_08_9l_zJLnmwtG-lsLHw.png" /><figcaption>Config the Target/Source/Socket</figcaption></figure><p><strong>Three phases:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMIKDLvKctZ1DqDpjO5ZvQ.png" /><figcaption>Different Phases</figcaption></figure><ul><li>The first phase runs for <strong>30 </strong>seconds with the arrival rate of <strong>50</strong>, which means every second <strong>50</strong> new users are added to the test. So, total connection will be <strong>30*50=1500.</strong></li><li>The 2nd phase with the <strong>rampUp </strong>option, runs for <strong>40 </strong>seconds and every second it should ramp arrivalRate <strong>50</strong> to <strong>55</strong> users.</li><li>In final phase it will maximize the load by increasing the duration <strong>45</strong> seconds and arrivalRate <strong>55 </strong>users.</li></ul><p>The final part of the load test profile is to define the operation or the scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Orf6dFngTyx7dZaXBmalBg.png" /><figcaption>Define the Scenario</figcaption></figure><p>If you take a close look at the scenarios section, you can see that first I defined the engine as “socketio”. <strong>-think: 60</strong> means connection will remain open for 60s.</p><p>Inside the flow action, I am sending a http get request but you can also do sending data with <strong>send</strong> and pausing execution with <strong>think.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*TzViWW--YtZ-zSK7sVpSeA.png" /><figcaption>Flow Action</figcaption></figure><p><strong>Run and Execute:</strong></p><p>Now, save the file as loadtest.yml . To run the test, execute the following command:</p><p><strong>$ artillery run loadtest.yml — — output result.json</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bwcs3FLLEUwbEuKdki9q1A.png" /><figcaption>Run the Script File</figcaption></figure><p>It makes artillery run the test with your test profile and saves the report in <strong>JSON </strong>format as <strong>result.json</strong>.</p><p>You may get following kind of warning. So for getting accurate performance better run this script from highly configured server as overall performance depends on your CPU usage.</p><blockquote>Warning:</blockquote><blockquote>CPU usage of Artillery seems to be very high (pids: 10112)which may severely affect its performance.See https://artillery.io/docs/faq/#high-cpu-warnings for details.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMzoaUNBGWIgAwm-yfL-Dw.png" /><figcaption>Log the Report as JSON Format</figcaption></figure><p><strong>Report Generate:</strong></p><p>You can read some useful information from the load test in the console, but we asked Artillery to save the results inside a JSON file. Artillery can convert JSON result into a human friendly HTML report.</p><p><strong>$ artillery report .\result.json</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*0Za0x8HSSJXYuVRBMChXgw.png" /><figcaption>Convert JSON Report to HTML</figcaption></figure><p>By running the command above, it will generate the HTML report and opens it inside a browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQ_ZXvcnJIUcgukyRWPPBQ.png" /><figcaption>HTML Report</figcaption></figure><p>Different charts are about requests per second, latency, concurrent users and etc.</p><p><strong>Limitations:</strong></p><p>As of now Artillery doesn’t have any option to check the socket response.</p><p>Moreover Artillery is a powerful tool to make a load test on your WebSockets. It’s easy to configure, and it supports a wide range of configuration for your load test scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f24d2a2f6d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn to generate and analyse HTML intuitive reports in JMeter]]></title>
            <link>https://haquemousume.medium.com/learn-to-generate-and-analyse-html-intuitive-reports-in-jmeter-574dbe1fca72?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/574dbe1fca72</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[non]]></category>
            <category><![CDATA[cmd]]></category>
            <category><![CDATA[gui]]></category>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Sun, 09 Feb 2020 09:30:11 GMT</pubDate>
            <atom:updated>2020-02-10T06:19:32.556Z</atom:updated>
            <content:encoded><![CDATA[<p>HTML reports are very intuitive. Most of the time development team and upper management need this report to evaluate performance of a particular site or application.</p><p>Basic steps of creating a JMeter file(.jmx) are as follows:</p><p><strong>Step 1:</strong> Thread group creation.</p><p><strong>Step 2:</strong> Sending request (HTTP Request).</p><p><strong>Step 3:</strong> Viewing the results using Listeners (Results in Tree or Table).</p><p><strong>Step 4:</strong> Run jmx file into Non GUI mode and generating the HTML reports.</p><p>There are two ways to generate html reports:</p><p><strong>Approach 1:</strong> to create report at the end of the test<br>————————————— — — — — — — — —<br>jmeter -n -t(path of .jmx file) -l(path of examples folder along with name of csv file where you want to keep the results) -e -o(path of output folder where you want to save the results)</p><p><strong>Approach 2:</strong> create report from a standalone csv file<br>———————————————— — — — — — —<br>jmeter -g (path of resultant csv file) -o (path of output folder where you want to save the results)</p><p><strong>Non GUI commands with explanation:</strong></p><p><strong># Jmeter -n :</strong> This command tells the command prompt I want to run my Jmeter script in Non GUI mode.</p><p><strong>#Jmeter -t :</strong> This will pick the Jmeter .jmx file and execute it. Here we give the path of jmx file which is under bin folder by default or could be in other folder.</p><p><strong># Jmeter -l :</strong> Here we give the path where we want to save the executed results into .csv format. We give the path of bin/example folder along with the same name of csv file. Better to create a folder named “csv” in bin/example folder to keep separate your csv and html files.</p><p><strong># Jmeter -e :</strong> This command is used to convert the .csv results into HTML format at the end of the test.</p><p><strong># Jmeter -g :</strong> [path to CSV file] generate report dashboard only.</p><p><strong># Jmeter -o :</strong> This command saves the html results into given output folder. Better to create a folder named “html” in bin/example folder to keep separate your csv and html files.</p><p><strong>Approach 1:</strong></p><p>To run the command first you have to go to the drive in which you kept the Jmeter. Let’s say I kept my Jmeter in E drive.</p><p><strong>Command:</strong> $ e:</p><p>Now go to the bin folder of your Jmeter.</p><p><strong>Command:</strong> $ cd E:\apache-jmeter-4.0\apache-jmeter-4.0\bin</p><p>Now execute the full command.</p><p><strong>Command: </strong>jmeter -n -t E:\Jmeter_jmx_Files\rides-proxy-twin-Foods.postman_collection.jmx -l E:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\csv\Food.csv -e -o E:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\html\Food</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OK7DzR-IVgewRdXylpl3A.png" /><figcaption>HTML report generation from CMD</figcaption></figure><p>Now go to the csv folder and you will find the Food.csv file then go to the html&gt;Food (output folder) and you will get there a index.html file which is your required html report.</p><p>To share the report, copy the .csv report to this folder and zip all these together and share. If you only share the index.html file it will not work, you have to share the whole folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96nnXuC_9w3gLWI60gt91g.png" /><figcaption>index.html Report</figcaption></figure><p><strong>Approach 2:</strong></p><p>Suppose you have already created your test and also have your report in csv file, now want to create the html reports from csv file.</p><p><strong>Command: </strong>jmeter -g E:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\csv\Food.csv -o E:\apache-jmeter-4.0\apache-jmeter-4.0\bin\examples\html\Food</p><p><strong>Step 5</strong>: Open the index.html file in your browser and you will find Dashboard and Charts. From dashboard you will get the <strong>APDEX</strong>, <strong>Result Summery</strong>, <strong>Statistics</strong>, <strong>Errors </strong>and<strong> Top 5 Errors by sampler</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vpvVB5R0qogPBeNmzT1jg.png" /><figcaption>Dashboard of HTML Report</figcaption></figure><p>From charts you will get different types of charts according to <strong>Over Time</strong>, <strong>Throughput</strong> and <strong>Response Times</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w1NUQWKch4xNNNjDKldpGQ.png" /><figcaption>Charts of HTML Report</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=574dbe1fca72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run postman requests/tests from command line (Newman)]]></title>
            <link>https://haquemousume.medium.com/how-to-run-postman-requests-tests-from-command-line-newman-f012afb06564?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f012afb06564</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[newman]]></category>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Sun, 26 Jan 2020 09:13:45 GMT</pubDate>
            <atom:updated>2020-04-16T08:43:55.108Z</atom:updated>
            <content:encoded><![CDATA[<p>Newman is a command line collection runner for Postman.</p><p>Let’s learn about Newman and how to run the postman collection using a command line tool with global variables and environment.</p><p><strong>Step 1:</strong> Check if node.js is already installed or not</p><p><strong>a)</strong> Open your cmd from your machine</p><p><strong>b)</strong> Type: <strong>node -v</strong></p><p>If found: ‘node’ is not recognized as an internal or external command, operable program or batch file</p><p>That means node.js is not installed your system yet.</p><p><strong>c)</strong> You can also try with: <strong>npm -v</strong></p><p>npm is node package manager which is used to installed packages over node.</p><p>If found: ‘npm’ is not recognized as an internal or external command, operable program or batch file</p><p>So again it’s not found node in the system.</p><p><strong>Step 2:</strong> Install node.js</p><p>Why we have to install node.js ? This question may come into your mind. Because Newman is node.js program and to get newman we have to first install node.js</p><p><strong>Official site: </strong><a href="https://www.youtube.com/redirect?q=https%3A%2F%2Fnodejs.org%2Fen%2Fdownload%2F&amp;redir_token=MdUSsRqoEt159uXE3ZZxrJbEPCl8MTU3NDQyMDAwM0AxNTc0MzMzNjAz&amp;event=video_description&amp;v=f2yMmOGZU7M"><strong>https://nodejs.org/en/download/</strong></a></p><p>So go to the download link and install node.js</p><p>During installation no need to check “Automatically install the necessary tools”.</p><p>Now again to check, Type: <strong>node -v</strong></p><p>And you will see the version of node.</p><p>Also Type: <strong>npm -v</strong></p><p>And you will get the version of npm.</p><p><strong>Step 3:</strong> Install Newman</p><p>Command:<strong> $</strong> <strong>npm install -g newman</strong></p><p>It will get Newman then install in your system. It will take couple of second.</p><p>After finishing the installation you can see it has added all the packages from contributors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qW2DgKvaHYFsgyHAXRPeA.png" /></figure><p>You can also check physically on your system whether it is installed or not.</p><p><strong>Go to: C drive &gt; Users &gt; AppData &gt; Roaming &gt; npm folder &gt; node_modules &gt; newman folder &gt; newman &amp; newman.cmd</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SETO19up6CvQzuqK6Y-ftg.png" /></figure><p><strong>Step 4:</strong> Export your Postman API collection as json file</p><p><strong>Step 5:</strong> On cmd go to that location of collection json file</p><p>Command: cd (space)(location)</p><p><strong>$ cd C:\Users\Mousume\Desktop\Postman_Collections&gt;</strong></p><p><strong>Step 6:</strong> Run the API collection</p><p>Command: newman run (space)(collection name)</p><p><strong>$ newman run Automation_Test.postman_collection.json&gt;</strong></p><p>Hit enter and here you go-</p><p>You will find, it was running everything what is inside your collection. There is GET request, test-scripts, POST request, prerequest-scripts.</p><p>And there is a log of entire over all summary showing iterations, requests, test-scripts, prerequest-scripts, assertions, total run duration, total data received, average response time and in case of any failure we get the details of failure and all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*xDYL79jJFTjfZcBCVVhhig.png" /></figure><p><strong>Step 8:</strong> With Environment and Global Variables. (use -e, -g)</p><p>Command: <strong>$ newman run Automation_Test.postman_collection.json -e enviroment.json -g global.json</strong></p><p><strong>Step 7</strong>: To get all newman commands/options</p><p>Command: <strong>$ newman run -h</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f012afb06564" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MULTIPLE USER LOGIN USING JMETER]]></title>
            <link>https://haquemousume.medium.com/multiple-user-login-using-jmeter-f1529247bbf2?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1529247bbf2</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[csv-file]]></category>
            <category><![CDATA[sessions]]></category>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Sun, 26 Jan 2020 06:50:34 GMT</pubDate>
            <atom:updated>2020-11-26T09:46:19.975Z</atom:updated>
            <content:encoded><![CDATA[<h3>Multiple User Login Using JMeter Parameterization</h3><p>JMeter an open source software is used to do load and performance testing and analyze the overall performance of dynamic web applications. If you need to load test of a Login Page with different username and passwords then you surely cannot hardcode the values, hence you need to parameterize the value.</p><p>Ans also it’s way more realistic to simulate concurrent users using unique logins and passwords because it’s closer to the real world load. In simple words, Parameterization in JMeter is the process where test plans are executed with multiple sets of user Input Data.</p><p>JMeter allows you to do parameterization using <a href="http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config">CSV Dataset Config</a>. By defining a CSV file containing all the login and password couples, JMeter can pick a line from the file on each user iteration and assign them into variables.</p><p><strong>Configuring different elements of CSV Data Set Config:</strong></p><ul><li><strong>FileName :</strong> If your file (.csv)is located at /bin then you can just use a FileName(.csv) and if it’s somewhere else, use the full path of file.</li><li><strong>Variable Names</strong> <strong>: </strong>This will contain all variable names(comma separated) which is equivalent to a “column name” in a csv file in the same order. If this field is kept empty, then JMeter will by default take the 1st row from csv file.</li><li><strong>Delimiter</strong> <strong>:</strong> It is used to separate each record in csv file. Comma is the default delimiter, but if your file uses tabs, then we need to define that here only.</li><li><strong>Allow quoted data?</strong> <strong>:</strong> Values can be put under “” (double quotes) which allows values to contain a delimiter, if enabled.</li><li><strong>Recycle on EOF?</strong> <strong>:</strong> If you plan to iterate over the csv file more than once you must set it <em>true </em>as it instructs JMeter to move back to the top of the CSV file.</li><li><strong>Stop thread on EOF?</strong> : Set it true if you want to stop after reading the whole csv file.</li><li><strong>Sharing mode :</strong></li></ul><ol><li>All threads: File is shared between all the threads.</li><li>Current thread group: Each file is opened once for each thread group in which the element appears.</li><li>Current thread: Each file is opened separately for each thread.</li></ol><p><strong>Step 1:</strong> Create a text file and enter values into it. Now save the text file with proper name and “<strong>.csv</strong>” extension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s0QNyDPElEtpC3_fA8jR0g.png" /><figcaption>userpass.csv</figcaption></figure><p><strong>Step 2: </strong>Then, in JMeter create a <strong>CSV Data Set Config</strong> under the <em>Thread Group. </em>Click on “Thread group-&gt; Add-&gt;Config Element -&gt; CSV Data Set Config”.</p><p><strong>Step 3: </strong>Now, open CSV Data Set Config and enter exact Filename and Parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6ukMssTuiLGrJiLBeTOSQ.png" /><figcaption>CSV Data Set Config</figcaption></figure><p><strong>Step 4:</strong> Create an HTTP Sampler under Thread Group and set the value <strong>${USER}</strong> for username, and <strong>${PASS}</strong> for password. You can choose the <strong>Name</strong> as your wish but <strong>Value</strong> should be same as CSV Data Set Config’s <strong>Variable Names(Comma Delimiter) </strong>with this format: <strong>${variable}.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRkczVtumrR9v27Krf7fpQ.png" /><figcaption>HTTP Request with parameters</figcaption></figure><p><strong>Step 5: </strong>Now all you need to do is run the script and verify the result for that. Click on “Thread group-&gt;Add &gt; Listener &gt; View Results Tree”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TLNab0KhcEHqSH4UhoEvFQ.png" /><figcaption>View Results Tree &amp; Verification</figcaption></figure><p>Remember to copy the CSV file to each load generator before running a distributed test. Also, make sure the file is located at the same place on each load generator.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1529247bbf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[POSTMAN Collection to .jmx(JMeter) File Conversion]]></title>
            <link>https://haquemousume.medium.com/postman-collection-to-jmx-jmeter-file-conversion-6c55bb527827?source=rss-451b0a2cf1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c55bb527827</guid>
            <dc:creator><![CDATA[Mousume Haque]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 03:58:59 GMT</pubDate>
            <atom:updated>2020-01-24T07:04:18.488Z</atom:updated>
            <content:encoded><![CDATA[<h3>POSTMAN Collection to .jmx(JMeter) File Conversion</h3><p>As there is no suitable add-ons or third party software to convert POSTMAN API Collection to JMeter(.jmx) file so it’s a challenging task. In this situation LOADIUM development team come up with a solution which convert Postman collection to Jmeter jmx file named <strong>postman2jmx</strong>.</p><p>You can find the project from GitHub by following link:</p><pre><a href="https://github.com/Loadium/postman2jmx">https://github.com/Loadium/postman2jmx</a></pre><p>Let’s get started step by step:</p><p><strong>Prerequisite:</strong></p><p>postman2jmx requires Java8+ and Maven 3+.</p><p><strong>Step 1:</strong> Install Git in your system:</p><p><strong>Installation Guide Link:</strong></p><pre><a href="https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/">https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/</a></pre><p><strong>Step 2:</strong> Now clone or download the project.</p><p>Command: <strong>$ git clone </strong><a href="https://github.com/Loadium/postman2jmx.git"><strong>https://github.com/Loadium/postman2jmx.git</strong></a></p><p><strong>Step 3:</strong> Install JDK and add/update the JAVA_HOME variable to JDK installation folder.</p><p><strong>JDK Download Link:</strong></p><pre><a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">https://www.oracle.com/technetwork/java/javase/downloads/index.html</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*GYqh-7wkX6UqcIYzQB8fDg.png" /><figcaption><strong>JAVA_HOME Environment Variable Set Up</strong></figcaption></figure><p><strong>Step 4:</strong> Download Maven and add ‘MAVEN_HOME’ and ‘M2_HOME’ Environment Variables to maven installation folder.</p><p><strong>Maven Download Link:</strong></p><pre><a href="https://maven.apache.org/download.cgi">https://maven.apache.org/download.cgi</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*9kbDRr2_F6wbWEkppu7aVg.png" /><figcaption><strong>MAVEN_HOME and M2_HOME Environment Variable Set Up</strong></figcaption></figure><p><strong>Step 5:</strong> Include ‘maven/bin’ directory in ‘PATH’ system variables.</p><p>To run maven from command prompt, this is necessary. Update the PATH variable with ‘Maven-installation/bin’ directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*v61ukekfVyI2Ya6sET1gGA.png" /><figcaption>System Variable Set Up</figcaption></figure><p><strong>Step 6:</strong> Now build the project. Go inside the folder where you cloned the repository previously and Shift + right click then open in powershell.</p><p>OR,</p><p>Command:<strong>$ cd postman2jmx</strong></p><p>Build Command:<strong>$ mvn package</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmJiNnToopjKnbg8Hi--tQ.png" /><figcaption><strong>Project Build</strong></figcaption></figure><p><strong>Step 7:</strong> After build, go to the Postman2Jmx folder. It is located under the target folder.</p><p>Command: <strong>$ cd target/Postman2Jmx</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzsWOBSwvuEjSH_4Y-vI9Q.png" /><figcaption><strong>Target Folder</strong></figcaption></figure><p><strong>Step 8:</strong> To convert your postman json collection file to the jmx file execute the following command.</p><p>Command: <strong>$ java -jar .\Postman2Jmx.jar my_postman_collection.json my_jmx_file.jmx</strong></p><p>NOTE: You have to specify the .jar file in this command and if your POSTMAN API Collection is saved in other driver or folder then put the directory path along with file name for both POSTMAN API Collection and JMeter(.jmx) file.</p><p>Example: <strong>$ java -jar .\Postman2Jmx.jar E:\Postman_Collection\my_postman_collection.json E:\Jmeter_jmx_Files\my_jmx_file.jmx</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_uQpgxuo8hAWC_5CzmnNA.png" /><figcaption><strong>Converted to .jmx File</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c55bb527827" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>