<?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 Niron Rasanjana on Medium]]></title>
        <description><![CDATA[Stories by Niron Rasanjana on Medium]]></description>
        <link>https://medium.com/@snironr?source=rss-81a44ee6299f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*EXYFYMeEIdtwizUSNMzFpA.jpeg</url>
            <title>Stories by Niron Rasanjana on Medium</title>
            <link>https://medium.com/@snironr?source=rss-81a44ee6299f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:38:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@snironr/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[Setup and Run your distributed JMeter load test in just 1 minute]]></title>
            <link>https://faun.pub/setup-and-run-your-distributed-jmeter-load-test-in-just-1-minute-cda0104ff9d8?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cda0104ff9d8</guid>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[distributed-testing]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[jmeter]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Fri, 10 Jun 2022 09:07:53 GMT</pubDate>
            <atom:updated>2022-06-10T10:02:48.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmQsze0fA8TlEhht3UA3qg.png" /></figure><p>When starting to load test a target system with Apache JMeter, we first write the JMeter tests with GUI in a local machine and and execute and debug the tests. Local execution is only okay for you to get test scripts working. If the team is in a hurry to get load test results, what we used to do is setup an VM and move the JMeter scripts in to the VM and execute the tests.</p><p>But what if need to run the tests couple of times? What if load tests results revealed issues in the performance? and after fixing the issues also you will have to rerun the tests on VM. And may be just one VM won’t be enough to run if you have to generate a huge load for your tests, then you will need to do a JMeter distributed setup with multiple workers.</p><p>What if there’s a way to setup run your load tests on a distributed setup with less time than you’ll take to setup a VM? What if you could integrate these tests in to the CI/CD pipeline? sounds good right? And that’s exactly what Azure has introduced with their Azure load testing preview.</p><p><strong>Azure Load Testing Preview </strong>is a fully managed load-testing service that enables you to generate high-scale load. Ultimately reducin time you spent provisioning and maintaining virtual machines and increase the time you spend load testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*VMpErKzInw4RlbHWwYvwWQ.png" /><figcaption>Azure load testing High level Architecture</figcaption></figure><h4>Prerequisites</h4><ul><li>An Azure account with an active subscription. If you don’t have an Azure subscription, <a href="https://azure.microsoft.com/free/?WT.mc_id=A261C142F">create a free account</a> before you begin.</li></ul><h4>Getting started with Azure Load Testing</h4><ul><li>Navigate to <a href="https://azure.microsoft.com/en-us/services/load-testing/">https://azure.microsoft.com/en-us/services/load-testing/</a></li><li>You’ll need to create load Testing resource</li><li>After creating the required resource, you will be navigated to the following page</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ShWTwMsjpfUCxH-UQmF_gA.png" /></figure><p>To implement your first test, click on the <strong>Tests</strong> button on left panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ufp0-C9kCivi6GnaruNt3g.png" /></figure><p>The above page is where you can see the list of tests. As you have not written any tests yet, your list will be empty.</p><h4>Create your first load test</h4><p>There are two ways to create load tests in Azure load tests,</p><ol><li>Create a quick test by using a web application URL.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TqcbiMKSYo2pSKhJ.png" /><figcaption>Quick tests don’t give you a lot of options. You can specify a URL and no. of concurrent users to hit the URL.</figcaption></figure><p>2. Create a test by uploading a JMeter test script (JMX).</p><p>This is the the one you should be working with. As you already know, for this method you should have a JMeter test script. You can use the following JMeter script I have created for a simple sample test. Just create a file in your local directory with name s<em>ampleloadtest.jmx</em> and paste the following code.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;jmeterTestPlan version=&quot;1.2&quot; properties=&quot;5.0&quot; jmeter=&quot;5.4.2&quot;&gt;<br>  &lt;hashTree&gt;<br>    &lt;TestPlan guiclass=&quot;TestPlanGui&quot; testclass=&quot;TestPlan&quot; testname=&quot;Test Plan&quot; enabled=&quot;true&quot;&gt;<br>      &lt;stringProp name=&quot;TestPlan.comments&quot;&gt;&lt;/stringProp&gt;<br>      &lt;boolProp name=&quot;TestPlan.functional_mode&quot;&gt;false&lt;/boolProp&gt;<br>      &lt;boolProp name=&quot;TestPlan.tearDown_on_shutdown&quot;&gt;true&lt;/boolProp&gt;<br>      &lt;boolProp name=&quot;TestPlan.serialize_threadgroups&quot;&gt;false&lt;/boolProp&gt;<br>      &lt;elementProp name=&quot;TestPlan.user_defined_variables&quot; elementType=&quot;Arguments&quot; guiclass=&quot;ArgumentsPanel&quot; testclass=&quot;Arguments&quot; testname=&quot;User Defined Variables&quot; enabled=&quot;true&quot;&gt;<br>        &lt;collectionProp name=&quot;Arguments.arguments&quot;&gt;<br>          &lt;elementProp name=&quot;concurrentUsers&quot; elementType=&quot;Argument&quot;&gt;<br>            &lt;stringProp name=&quot;Argument.name&quot;&gt;concurrentUsers&lt;/stringProp&gt;<br>            &lt;stringProp name=&quot;Argument.value&quot;&gt;${__BeanShell( System.getenv(&amp;quot;concurrentUsers&amp;quot;) )}&lt;/stringProp&gt;<br>            &lt;stringProp name=&quot;Argument.metadata&quot;&gt;=&lt;/stringProp&gt;<br>          &lt;/elementProp&gt;<br>          &lt;elementProp name=&quot;rampUpTime&quot; elementType=&quot;Argument&quot;&gt;<br>            &lt;stringProp name=&quot;Argument.name&quot;&gt;rampUpTime&lt;/stringProp&gt;<br>            &lt;stringProp name=&quot;Argument.value&quot;&gt;${__BeanShell( System.getenv(&amp;quot;rampUpTime&amp;quot;) )}&lt;/stringProp&gt;<br>            &lt;stringProp name=&quot;Argument.metadata&quot;&gt;=&lt;/stringProp&gt;<br>          &lt;/elementProp&gt;<br>        &lt;/collectionProp&gt;<br>      &lt;/elementProp&gt;<br>      &lt;stringProp name=&quot;TestPlan.user_define_classpath&quot;&gt;&lt;/stringProp&gt;<br>    &lt;/TestPlan&gt;<br>    &lt;hashTree&gt;<br>      &lt;ThreadGroup guiclass=&quot;ThreadGroupGui&quot; testclass=&quot;ThreadGroup&quot; testname=&quot;Thread Group&quot; enabled=&quot;true&quot;&gt;<br>        &lt;stringProp name=&quot;ThreadGroup.on_sample_error&quot;&gt;continue&lt;/stringProp&gt;<br>        &lt;elementProp name=&quot;ThreadGroup.main_controller&quot; elementType=&quot;LoopController&quot; guiclass=&quot;LoopControlPanel&quot; testclass=&quot;LoopController&quot; testname=&quot;Loop Controller&quot; enabled=&quot;true&quot;&gt;<br>          &lt;boolProp name=&quot;LoopController.continue_forever&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;stringProp name=&quot;LoopController.loops&quot;&gt;1&lt;/stringProp&gt;<br>        &lt;/elementProp&gt;<br>        &lt;stringProp name=&quot;ThreadGroup.num_threads&quot;&gt;${concurrentUsers}&lt;/stringProp&gt;<br>        &lt;stringProp name=&quot;ThreadGroup.ramp_time&quot;&gt;${rampUpTime}&lt;/stringProp&gt;<br>        &lt;boolProp name=&quot;ThreadGroup.scheduler&quot;&gt;false&lt;/boolProp&gt;<br>        &lt;stringProp name=&quot;ThreadGroup.duration&quot;&gt;&lt;/stringProp&gt;<br>        &lt;stringProp name=&quot;ThreadGroup.delay&quot;&gt;&lt;/stringProp&gt;<br>        &lt;boolProp name=&quot;ThreadGroup.same_user_on_next_iteration&quot;&gt;true&lt;/boolProp&gt;<br>      &lt;/ThreadGroup&gt;<br>      &lt;hashTree&gt;<br>        &lt;HTTPSamplerProxy guiclass=&quot;HttpTestSampleGui&quot; testclass=&quot;HTTPSamplerProxy&quot; testname=&quot;jsonplaceholder Request&quot; enabled=&quot;true&quot;&gt;<br>          &lt;elementProp name=&quot;HTTPsampler.Arguments&quot; elementType=&quot;Arguments&quot; guiclass=&quot;HTTPArgumentsPanel&quot; testclass=&quot;Arguments&quot; enabled=&quot;true&quot;&gt;<br>            &lt;collectionProp name=&quot;Arguments.arguments&quot;/&gt;<br>          &lt;/elementProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.domain&quot;&gt;jsonplaceholder.typicode.com&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.port&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.protocol&quot;&gt;https&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.contentEncoding&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.path&quot;&gt;/posts&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.method&quot;&gt;GET&lt;/stringProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.follow_redirects&quot;&gt;true&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.auto_redirects&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.use_keepalive&quot;&gt;true&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.DO_MULTIPART_POST&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.embedded_url_re&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.connect_timeout&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.response_timeout&quot;&gt;&lt;/stringProp&gt;<br>        &lt;/HTTPSamplerProxy&gt;<br>        &lt;hashTree/&gt;<br>        &lt;HTTPSamplerProxy guiclass=&quot;HttpTestSampleGui&quot; testclass=&quot;HTTPSamplerProxy&quot; testname=&quot;facebook Request&quot; enabled=&quot;true&quot;&gt;<br>          &lt;elementProp name=&quot;HTTPsampler.Arguments&quot; elementType=&quot;Arguments&quot; guiclass=&quot;HTTPArgumentsPanel&quot; testclass=&quot;Arguments&quot; enabled=&quot;true&quot;&gt;<br>            &lt;collectionProp name=&quot;Arguments.arguments&quot;/&gt;<br>          &lt;/elementProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.domain&quot;&gt;<a href="http://www.facebook.com/">www.facebook.com</a>&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.port&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.protocol&quot;&gt;https&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.contentEncoding&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.path&quot;&gt;/login&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.method&quot;&gt;GET&lt;/stringProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.follow_redirects&quot;&gt;true&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.auto_redirects&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.use_keepalive&quot;&gt;true&lt;/boolProp&gt;<br>          &lt;boolProp name=&quot;HTTPSampler.DO_MULTIPART_POST&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.embedded_url_re&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.connect_timeout&quot;&gt;&lt;/stringProp&gt;<br>          &lt;stringProp name=&quot;HTTPSampler.response_timeout&quot;&gt;&lt;/stringProp&gt;<br>        &lt;/HTTPSamplerProxy&gt;<br>        &lt;hashTree/&gt;<br>        &lt;ResultCollector guiclass=&quot;ViewResultsFullVisualizer&quot; testclass=&quot;ResultCollector&quot; testname=&quot;View Results Tree&quot; enabled=&quot;true&quot;&gt;<br>          &lt;boolProp name=&quot;ResultCollector.error_logging&quot;&gt;false&lt;/boolProp&gt;<br>          &lt;objProp&gt;<br>            &lt;name&gt;saveConfig&lt;/name&gt;<br>            &lt;value class=&quot;SampleSaveConfiguration&quot;&gt;<br>              &lt;time&gt;true&lt;/time&gt;<br>              &lt;latency&gt;true&lt;/latency&gt;<br>              &lt;timestamp&gt;true&lt;/timestamp&gt;<br>              &lt;success&gt;true&lt;/success&gt;<br>              &lt;label&gt;true&lt;/label&gt;<br>              &lt;code&gt;true&lt;/code&gt;<br>              &lt;message&gt;true&lt;/message&gt;<br>              &lt;threadName&gt;true&lt;/threadName&gt;<br>              &lt;dataType&gt;true&lt;/dataType&gt;<br>              &lt;encoding&gt;false&lt;/encoding&gt;<br>              &lt;assertions&gt;true&lt;/assertions&gt;<br>              &lt;subresults&gt;true&lt;/subresults&gt;<br>              &lt;responseData&gt;false&lt;/responseData&gt;<br>              &lt;samplerData&gt;false&lt;/samplerData&gt;<br>              &lt;xml&gt;false&lt;/xml&gt;<br>              &lt;fieldNames&gt;true&lt;/fieldNames&gt;<br>              &lt;responseHeaders&gt;false&lt;/responseHeaders&gt;<br>              &lt;requestHeaders&gt;false&lt;/requestHeaders&gt;<br>              &lt;responseDataOnError&gt;false&lt;/responseDataOnError&gt;<br>              &lt;saveAssertionResultsFailureMessage&gt;true&lt;/saveAssertionResultsFailureMessage&gt;<br>              &lt;assertionsResultsToSave&gt;0&lt;/assertionsResultsToSave&gt;<br>              &lt;bytes&gt;true&lt;/bytes&gt;<br>              &lt;sentBytes&gt;true&lt;/sentBytes&gt;<br>              &lt;url&gt;true&lt;/url&gt;<br>              &lt;threadCounts&gt;true&lt;/threadCounts&gt;<br>              &lt;idleTime&gt;true&lt;/idleTime&gt;<br>              &lt;connectTime&gt;true&lt;/connectTime&gt;<br>            &lt;/value&gt;<br>          &lt;/objProp&gt;<br>          &lt;stringProp name=&quot;filename&quot;&gt;&lt;/stringProp&gt;<br>        &lt;/ResultCollector&gt;<br>        &lt;hashTree/&gt;<br>      &lt;/hashTree&gt;<br>    &lt;/hashTree&gt;<br>  &lt;/hashTree&gt;<br>&lt;/jmeterTestPlan&gt;</pre><p>If you open the above test with your locally installed JMeter app, it will look as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ncaJKL3jdKWgMA4jxgbjw.png" /><figcaption>Test plan (figure 1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQFhINDQTj_RXL83qCOIzA.png" /><figcaption>Thread group (figure 2)</figcaption></figure><p>If you look in user defined variables of the Test plan (figure 1), you can see I have parameterized them as system variables and used the values inside the thread group for Thread properties. Later we will be setting up our azure tests to pass values in to those parameters.</p><h4>Upload test plan</h4><p>Ok, now we’re ready to start creating our first test. Just go ahead and click on <strong>Create</strong> button in the test plans page and select <strong>Upload a JMeter script </strong>from the drop down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUUe0meX94ruIH4UG0ynBQ.png" /></figure><p>Enter a name and description to your test plan.</p><p>Click next button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpQu1jrVxhxI5DfVj9KzZw.png" /></figure><p>Select the .jmx we created from your local directory and click <strong>Upload.</strong></p><p>once uploaded, click next button.</p><h4>Configure parameters</h4><p>Now you are in the Parameters page. You can add parameters as Environment variables or Secrets which are sensitive parameters (user credentials, etc.) Those secrets will be stored in Azure Key Vault and you can read more about that <a href="https://docs.microsoft.com/en-gb/azure/load-testing/how-to-parameterize-load-tests?wt.mc_id=azureportal_loadtesting_inproduct_params#secrets">here</a>.</p><p>As we have only parameterized the no. of concurrent users and ramp up period in our tests, we can use environment variables to pass them. Add the parameters as follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf3z9VrOLnDsoSaBMPcY_g.png" /></figure><p>The values we enter for the parameters will be used as default values when executing the tests, but you can also customize them later.</p><p>Click next.</p><h4>Configure test engines</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*CPf9MUXLMzuVf80lYr0ycQ.gif" /></figure><p>Test engine instances are responsible for executing a test plan. Each test engine executes the Apache JMeter script. The test engine instances run in parallel. They allow you to define how you want to scale out the load test execution for your application. Azure recommend that you keep the number of threads below a maximum of 250 in the test plan.</p><p>For example, to simulate 1,000 threads (or virtual users), set the number of threads in the Apache JMeter script to 250. Then configure the test with four test engine instances (that is, 4 x 250 threads). As we have already parameterized the Threads value in the test plan, we can set the value when running the tests.</p><p>As we are not going to put a huge load in the example, I’m going to keep the instances to just 1. Click next button.</p><p><strong>Test criteria</strong></p><p>In Test criteria you can define when to fail a test.</p><p>We have following 2 metrics right now,</p><ol><li>Response_time_ms</li><li>Error</li></ol><p>After selecting the Metric you can select the Aggregate function (average, percentage), and condition as Greater than and the Threshold number.</p><p>for example, You can define criteria to fail the test when Error percentage is grater than 1%. Also you can define multiple criteria up to 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBF6VCT_5JN7KaXr9YoA2w.png" /></figure><h4>Monitoring</h4><p>With this feature you can monitor server-side application metrics in real time for Azure-hosted applications when running a load tests. It’s a very useful and powerful feature for identifying performance issues and bottlenecks with the resources. You no longer need to ask the area owners to check logs and monitor the resources and rerun the tests when there is an issue.</p><p>To monitor resource metrics for an Azure-hosted application, you need to specify the list of Azure application components in your load test. Azure Load Testing automatically captures a set of relevant resource metrics for each selected component. When your load test finishes, you can view the server-side metrics in the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HWFtZKbH3gipja6U.png" /></figure><h4>Review + create</h4><p>That’s it! Now we are done with creating the load test plan. You can click <strong>Create</strong> button to finish things.</p><p>Your test will auto trigger for the first time and if everything goes right you will be able to see the results as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDZkwANFl50HlTdRvNGqEw.png" /><figcaption>We had 2 http requests in our test plan and we ran with 20 concurrent users, resulting Total 40 requests.</figcaption></figure><h4>Download reports</h4><p>If you need more information about the requests specially when there are errors, you can download the results by clicking on the <strong>Download</strong> button and selecting <strong>Results</strong>.</p><p>A file will downloaded in .csv format. For you to read the data in this file, you can open the report with a JMeter listener. I prefer using “View Results Tree”. Just create a new test plan in JMeter and add Listener <em>View Results Tree. </em>Go to the Listener and browse and import the downloaded .csv file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mrmhvjzgBdnrznfTRV1h_w.png" /></figure><h4>Running tests again</h4><p>To run the tests again click on your test plan name.</p><p>You will be navigated a page with history of the tests runs of the plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGnP6pU4zwVTXAp0GySUhQ.png" /></figure><p>Click on <strong>Run </strong>button. A panel will pop up to setup the test. Here also you can edit the parameter values you have set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*fd1cyA5Ns5pry1SOLqnnbA.png" /><figcaption>Increased my concurrent users to 100. Add a purpose of the execution so you can find later.</figcaption></figure><h4>Test failures</h4><p>When there are test failures, the dashboard will look as follows. You can dig deeper in to the results by download and opening the report .csv with JMeter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdkIlzjezcaxOwVRME6ufw.png" /><figcaption>Failures from another test</figcaption></figure><h3>Other cool features in Azure Load Testing Preview</h3><h4>Move between Regions</h4><p>Azure Load Testing resources are region-specific and can’t be moved across regions automatically. You can use an Azure Resource Manager template (ARM template) to export the existing configuration of your Load Testing resource instead. Then, stage the resource in another region and create the tests in the new resource. <a href="https://docs.microsoft.com/en-gb/azure/load-testing/how-to-move-between-regions">Read more </a>about how to do this.</p><h4>Server side Monitoring</h4><p>As I mentioned earlier you can setup server side monitoring for your tests and create a dashboard as follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2_zSATaCXaTjuSUE.png" /></figure><h4>Identify performance regressions by comparing test runs</h4><p>You can compare load test runs for the following scenarios:</p><ul><li>Identify performance regressions between application builds or configurations. You could run a load test at each development sprint to ensure that the previous sprint didn’t introduce performance issues.</li><li>Identify which application component is responsible for a performance problem (root cause analysis). For example, an application redesign might result in slower application response times. Comparing load test runs might reveal that the root cause was a lack of database resources.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_llI_fJw_RiPKs-P.png" /></figure><h4>Continuous regression testing</h4><p>You can set up an <a href="https://docs.microsoft.com/en-gb/azure/load-testing/tutorial-cicd-azure-pipelines">Azure Pipelines</a> CI/CD workflow or <a href="https://docs.microsoft.com/en-gb/azure/load-testing/tutorial-cicd-github-actions">GitHub Actions</a> CI/CD workflow to deploy your application and trigger a load test using the <a href="https://github.com/marketplace/actions/azure-load-testing">Azure Load Testing action</a>.</p><h3>Conclusion :</h3><p>Azure Load Testing is currently in preview and very new to the users. There are bugs and required features yet to come but still this offers a lot of powerful features that will make your life easier. Most of the projects do performance tests at later stage of the development just before the releases, so it is very challenging for QAs and developers to write the tests, prepare the distributed environments, Execute the tests in a short amount of time. Azure Load Testing take care of more than half of that effort and helps you identifying the performance bottlenecks too.</p><p>Azure load testing product documentation : <a href="https://docs.microsoft.com/en-gb/azure/load-testing/">https://docs.microsoft.com/en-gb/azure/load-testing/</a></p><p>Report issues here : <a href="https://github.com/microsoft/azure-load-testing/issues">https://github.com/microsoft/azure-load-testing/issues</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3e89cLPiH8SVMgWX.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cda0104ff9d8" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/setup-and-run-your-distributed-jmeter-load-test-in-just-1-minute-cda0104ff9d8">Setup and Run your distributed JMeter load test in just 1 minute</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use Asgardeo as IDP in your Choreo application]]></title>
            <link>https://faun.pub/use-asgardeo-as-idp-in-your-choreo-application-d1fd6f38951?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1fd6f38951</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[choreo]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[idp]]></category>
            <category><![CDATA[asgardeo]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Tue, 05 Apr 2022 09:14:35 GMT</pubDate>
            <atom:updated>2022-04-07T15:47:18.699Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2KCKmSIB6PzzcKzh11b2w.jpeg" /></figure><h4>Configuring Asgardeo Organization</h4><ul><li>Log in to Asgardeo account and navigate to <strong>Develop </strong>section.</li><li>Under <strong>Applications </strong>click <strong>New Application</strong></li><li>Select “<strong>Standard-Based Application</strong>” under Register an application templates.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*rSaGxv6dQZBXEWxEr7XqZg.png" /></figure><ul><li>Give a name to your app and select <strong>OAuth2.0 OpenID Connect</strong> as protocol</li><li>You will be redirected to the create application. Go to the Protocol tab.</li><li>Tick the “<strong>Password</strong>” grant-type under <strong>Allowed grant types</strong>. This is the grant type used by application to communicate with the token service</li><li>Select “<strong>JWT</strong>” as Token type</li><li>We need to add Audience under ID Token, in our case it’s the token endpoint used by choreo devportal to generate the token. “<a href="https://sts.choreo.dev/oauth2/token">https://sts.choreo.dev/oauth2/token</a>” You can find this endpoint by navigating to devportal &gt; your app &gt; Production keys &gt; Token Endpoint</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvL4rCcUZkthoQ7cL48zDQ.png" /></figure><ul><li>Once done click update button. We will later use the Client ID and Client secret in this page to generate token.</li><li>Navigate to the “<strong>Info</strong>” tab and under Server Endpoints copy the Discovery endpoint.</li></ul><h4>Configuring Choreo</h4><ul><li>Now we are going to configure choreo to use Asgardeo as IDP</li><li>Login to Choreo and Navigate to “Settings” page</li><li>Click “API Management” tab</li><li>Under Identity providers click “<strong>Add Provider</strong>”</li><li>Select WSO2 Asgardeo as Identity provider.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*pSBvKskdv6cUYd4TNv42gA.png" /></figure><ul><li>Enter name for the IDP and paste the Discovery url we copied earlier from Asgardeo in to the Well-Known URL field.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUEOzQ8yAt0VU-tEAQD3LA.png" /></figure><p>Click next button and click Done.</p><h4>Configuring Choreo DevPortal Application</h4><ul><li>Navigate to Choreo Devportal</li><li>Go to the <strong>Production keys </strong>page of your target Application.</li><li>Click <strong>Advanced Configurations</strong></li><li>Make sure <strong>Token Exchange </strong>is ticked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8q_iV0-Sbef3hmi0GmV5ZQ.png" /></figure><ul><li>Update the token expiry as required and click <strong>Update</strong> button.</li><li>Now we’re done with the configurations.</li></ul><h4>Token Generation</h4><ol><li><strong>Generate the Asgardeo exchange token</strong></li></ol><p>You can use following curl to generate the Asgardeo exchange token</p><pre>curl -X POST \<br>  &lt;Token_Endpoint&gt;\<br>  -H &#39;authorization: Basic &lt;Base64Encoded(Client_Id:Client_Secret)&gt;&#39; \<br>  -H &#39;content-type: application/x-www-form-urlencoded&#39; \<br>  -d &#39;grant_type=password&amp;username=&lt;asgardeo_user&gt;&amp;password=&lt;asgardeo_user_pw&gt;&#39;</pre><p>Replace the followings:</p><ul><li>&lt;Token_Endpoint&gt; - Can be found in asgardeo &gt; Application &gt; Info &gt; Token</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EnLjpm_kSj0U7E-6Lr7L9w.png" /></figure><ul><li>&lt;Client_Id&gt; - Can be found in asgardeo &gt; Application &gt;Protocol &gt; Client ID</li><li>&lt;Client_Secret&gt; - Can be found in asgardeo &gt; Application &gt;Protocol &gt; Client Secret</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNVhpO4V1gQoCWbFES5Jkw.png" /></figure><ul><li>&lt;asgardeo_user&gt; - Username of an user created in asgardeo org(Can be found under Manage &gt; Users)</li><li>&lt;asgardeo_user_pw&gt; - password of an user created in asgardeo org</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zf0xuGD3g6yilHd4xrj5Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsC_ACvLYec-Z7QSKhL5dw.png" /><figcaption>snap of access token generated with above curl using postman</figcaption></figure><p>2. <strong>Generate the Access token for devPortal app with Token exchange grant</strong></p><pre>curl --location --request POST &#39;https://sts.st.choreo.dev/oauth2/token&#39; \<br>--header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>--header &#39;Authorization: Basic &lt;base64_encoded(ConsumerKey:Secret)&gt;‘\<br>--data-urlencode &#39;grant_type=urn:ietf:params:oauth:grant-type:token-exchange&#39; \<br>--data-urlencode &#39;subject_token=&lt;idp_token&gt;&#39; \<br>--data-urlencode &#39;subject_token_type=urn:ietf:params:oauth:token-type:jwt&#39; \<br>--data-urlencode &#39;requested_token_type=urn:ietf:params:oauth:token-type:jwt&#39;</pre><p>Replace the followings:</p><ul><li>&lt;ConsumerKey:Secret&gt; - These are of your devportal app</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt_yX9jxNM2n7qlb99QVLw.png" /></figure><ul><li>&lt;idp_token&gt; - This is the Asgardeo access token we generated earlier.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U3TMrsn-oFn_r30aFw0tdw.png" /><figcaption>Snap of a token generated with above curl via postman</figcaption></figure><p>Now you can use this access token to access your Choreo APIs subscribed to the Application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*dHVkFm3_Z_r_hI15.gif" /></figure><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1fd6f38951" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/use-asgardeo-as-idp-in-your-choreo-application-d1fd6f38951">Use Asgardeo as IDP in your Choreo application</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PostgreSQL Docker Creation and Backup databases]]></title>
            <link>https://faun.pub/postgresql-docker-creation-and-backup-databases-3a11187e4571?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a11187e4571</guid>
            <category><![CDATA[database-backup]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Tue, 15 Dec 2020 09:11:57 GMT</pubDate>
            <atom:updated>2020-12-17T10:23:45.644Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Py0hTKUIEvMC8c4JmQQocQ.jpeg" /></figure><h4>Pull PostgreSQL image on Docker and run</h4><p>Open terminal and execute the following commands.</p><pre>docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=Sample_Password postgres:10</pre><p>In the above line, the required version is specified as “postgres:10”. Refer the <a href="https://hub.docker.com/_/postgres">documentation</a> for a list of supported versions.</p><h4>Step in to postGre docker</h4><pre>docker exec -it postgres “bash”<br>su — postgres</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXtTBZeGAjnntrewNGInsA.png" /><figcaption>View of our created docker image from the docker desktop</figcaption></figure><h4>Create database and user</h4><pre>createdb sample_db<br>createuser sample_user</pre><h4>Step inside the sql command line</h4><pre>psql</pre><h4>Grant access to the database</h4><pre>alter user sample_user with encrypted password ‘password’;</pre><pre>grant all privileges on database sample_db to sample_user;</pre><h4>Backup your databases</h4><pre>docker exec -t db_container pg_dumpall -c -U postgres &gt; dump_`date +%d-%m-%Y”_”%H_%M_%S`.sql</pre><blockquote>Replace the db_container with your container ID.</blockquote><p>An sql dump file will be created in the current directory of the terminal.</p><h4>Restore your database backup</h4><pre>cat dump_file_name.sql | docker exec -i db_container psql -U postgres</pre><blockquote>Replace the <em>db_container</em> with your container ID and dump_file_name with your backup file name.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a11187e4571" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/postgresql-docker-creation-and-backup-databases-3a11187e4571">PostgreSQL Docker Creation and Backup databases</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Force shutdown/Kill WSO2 Servers running in a Windows environment]]></title>
            <link>https://snironr.medium.com/force-shutdown-kill-wso2-servers-running-in-a-windows-environment-70b21da4cd86?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/70b21da4cd86</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[apim]]></category>
            <category><![CDATA[wso2is]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Fri, 04 Dec 2020 11:35:58 GMT</pubDate>
            <atom:updated>2020-12-04T11:35:58.602Z</atom:updated>
            <content:encoded><![CDATA[<p>Not properly ended processes will make troubles when starting a Wso2 product. Follow the below steps to forcefully end these process.</p><p>Step 1: Open Task manager and move to <strong>Performance</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mx-Fwf2gK7AAWMcSMzlSHQ.png" /></figure><p>Step 2 : Click <strong>Open Resource Monitor</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*nFB2s2Wy3c6AIp7gNHSQfg.png" /></figure><p>Steps 3 : Go to <strong>CPU</strong> tab and click the drop down in <strong>Associate Handles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iFm7CzxQ7MNssimboCtokg.png" /></figure><p>Steps 4 : Now go to the directory of which the product is running. In my case Wso2 API Manager 3.2.0. Copy whole path of the directory or the Root folder name is enough. ie, wso2am-3.2.0</p><p>Step 5 : Paste the directory path/name in Associated Handles Search box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ql7klgteyF8yQiA_o4I83Q.png" /></figure><p>Step 6 : Right click on any of the listed items and click <strong>end process.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_04LsMNLWk-AR7doNa6oA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70b21da4cd86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enable JDBC Spy Logs for WSO2 API Manager 3.x.x with Log4jdbc]]></title>
            <link>https://snironr.medium.com/enable-jdbc-spy-logs-for-wso2-api-manager-3-x-x-with-log4jdbc-3dc9fa5199e?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dc9fa5199e</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[log4jdbc]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[jdbc-driver]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 09:59:11 GMT</pubDate>
            <atom:updated>2020-07-23T09:59:11.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbktiHUx_UMNpLUVuqC3PQ.jpeg" /></figure><p>If you want to take a peek in to database queries executed when using wso2 API Manager you can accomplish that with the help of Log4jdbc. Log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls.</p><h4>Step 1 : Download log4jdbc driver and place it.</h4><ul><li>Download the latest log4jdbc driver from <a href="https://code.google.com/archive/p/log4jdbc/downloads">here</a>.</li><li>Copy the driver in to &lt;API_HOME&gt;/repository/components/lib/ directory.</li></ul><h4>Step 2 : Configure deployment.toml with new driver</h4><p>Navigate to &lt;API_HOME&gt;/repository/conf/ and do the following changes in deployment.toml file.</p><ul><li>Change JDBC URL like below by adding <strong>:log4jdbc</strong>.</li></ul><pre>url = “jdbc:log4jdbc:mysql://localhost:3306/AM_DB”</pre><ul><li>Add the driver</li></ul><pre>driver = “net.sf.log4jdbc.DriverSpy”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QjH0wlGBrrOTla7IxL6KKg.png" /><figcaption>Configured deployment.toml</figcaption></figure><h4>Step 3 : Configure log4j2.properties</h4><p>As Wso2 API Manager 3.x.x versions are using log4j2 for logging, Following configurations needs to be added for log4jdbc.</p><ul><li>Open log4j2.properties file in &lt;API_HOME&gt;/repository/conf/ directory.</li><li>Add the following lines.</li></ul><pre>logger.jdbc_logger.name=jdbc.sqlonly<br>logger.jdbc_logger.level=INFO</pre><ul><li>In the loggers section append jdbc_logger with a comma.</li></ul><p>Other than sqlonly option you can use following options also.</p><ul><li><strong>jdbc.sqltiming:</strong> Logs time taken by each SQL to execute.</li><li><strong>jdbc.audit:</strong> Logs all the activities of the JDBC (Except Result sets).</li><li><strong>jdbc.resultset:</strong> Includes the audit and plus Result set activities.</li><li><strong>jdbc.connection:</strong> Connection details like opening and closing the database connections will be logged.</li></ul><p>That’s it! sql logs will be displayed as follows,</p><pre>[2020–07–23 14:50:33,399] INFO — sqlonly SELECT API.API_ID FROM AM_API API WHERE API.API_PROVIDER = ‘admin’ AND API.API_NAME = ‘niron_api’<br>AND API.API_VERSION = ‘1’</pre><pre>[2020–07–23 14:50:33,400] INFO — sqlonly SELECT CAST( SUM(RATING) AS DECIMAL)/COUNT(RATING) AS RATING FROM AM_API_RATINGS WHERE API_ID<br>=1 GROUP BY API_ID</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dc9fa5199e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated front-end testing for Developers]]></title>
            <link>https://faun.pub/automated-front-end-testing-for-developers-d9532ee91575?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9532ee91575</guid>
            <category><![CDATA[web-automation]]></category>
            <category><![CDATA[ui-testing]]></category>
            <category><![CDATA[testing-tools]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[cypress]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 14:41:14 GMT</pubDate>
            <atom:updated>2020-03-02T20:06:12.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtDCexRbeIvAFlWyOUtLxw.jpeg" /></figure><p>Writing automated tests have not been an easy task, specially when it comes to front-end E2E testing.</p><p>Reasons for this is,</p><ul><li>You need to have some expertise in automated testing tool (ex: Selenium)</li><li>These open source tools requires to be integrated with a testing framework. (ex : TestNG)</li><li>Needs a design pattern like page object model.</li></ul><p>These are just to get started with. Even if you do,</p><ul><li>It’s slow to run</li><li>Hard to maintain</li><li>Hard to make reliable. Needs to deal with the waits. This can be a hell and cause in flaky tests.</li></ul><p>So for a developer it’s lot of work and consumes time, even just get stated with a automated testing. That’s why most of the companies hire automated testers separately.</p><p>When it comes to automated E2E testing web applications, Selenium is the one that has been here for a long time and with the largest community. That’s why above points are also focused on selenium.</p><p>Is selenium the only option for Web application automation? Of course not there are many selenium alternatives now. So I did some homework to find a good automation tool for front-end E2E testing.</p><p>Out of all the testing tools, <strong>Cypress</strong> can be the one for developers. My statement is based on following factors,</p><ul><li>It it so easy to setup and get started with — Couple of simple commands and you are good to go.</li><li>Highly independent — No extra frameworks needs to be integrated</li><li>There are no servers, drivers, or any other dependencies to install or configure. You can write your first passing test in 60 seconds.</li><li>Automatic Waiting — No need to add sleeps or waits. Cypress has it’s own intelligent waits so no more flaky tests.</li><li>Unlike Selenium its is fast, consistent and reliable test so again no flaky tests.</li></ul><h3>How easy it is to get started with Cypress?</h3><p>Fairly easy I would say. Only the following two commands are needed.</p><pre><em>npm init</em></pre><pre><em>npm install cypress — save-dev</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*VI_AP0qIu1XIkRw2Fg_2-A.gif" /></figure><h3>Let’s write our first test</h3><p>Before writing tests let’s open Cypress with following command,</p><pre><em>npx cypress open</em></pre><p>Cypress comes with some sample tests that will let you get some idea about writing tests inside “<em>/cypress/integration/examples”</em> folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*2WjMU4ogABDM4ElL2Vj9-g.png" /></figure><p>Let’s Create a folder inside <em>cypress/integration</em> and create new file named firstTest_spec.js</p><p>Below is a code snippet of an End-to-end test scenario.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31da826b288765f3f9db2b35a412d341/href">https://medium.com/media/31da826b288765f3f9db2b35a412d341/href</a></iframe><p>In the above test I have used .contains, .get and .xpath as my element locators cause my web application was not designed expecting to be automated. As a best practice Cypress designers recommends to add data-cy attributes to make it easier to target elements.</p><pre>cy.get(‘[data-cy=submit]’).click()</pre><p>beforeEach(), after() are hooks I have used borrowed from Mocha.</p><pre>before(function() {<br> // runs once before all tests in the block<br> })</pre><pre>after(function() {<br> // runs once after all tests in the block<br> })</pre><pre>beforeEach(function() {<br> // runs before each test in the block<br> })</pre><pre>afterEach(function() {<br> // runs after each test in the block<br> })</pre><h3>Let’s Run the Test</h3><ul><li>Go to Cypress Interface.</li><li>Now your firstTest_spec.js will be displayed under integration tests.</li><li>Click on firstTest_spec.js</li><li>Test will start running and you can watch tests run in real time against test steps.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HsMeouaRL9vV_OrVhIs1IA.gif" /></figure><p><strong>How awesome was that?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Zlmi2fmMB_-yZU6OIXMiJQ.gif" /></figure><p>Hold on, it get’s better. Let’s intentionally fail one test step and see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*loUX8WpUnuqa1noLF1zdkA.gif" /></figure><p>In the above demonstration the failed step is highlighted and shown with the exact error. Other than that Cypress gives a recording of the test steps. When you hover over step it will demonstrate how the browser behaved at that step. debugging can’t get any easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*rxQ5bIr7Z0KTtkngRlOJQg.png" /><figcaption>Selector Playground</figcaption></figure><p>By clicking on the Open Selector Playground (small crosshair icon) you can,</p><ul><li>Determine a unique selector for an element.</li><li>See what elements match a given selector.</li><li>See what element matches a string of text. (can be changed to .contains)</li></ul><h3>Cross Browser Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*kbRD6zL19-p4dseQURdLLQ.gif" /></figure><p>In the Cypress interface, select the browser you need to run the tests or in the command line,</p><pre>cypress run — browser chrome</pre><p>Cypress supports <a href="https://docs.cypress.io/guides/guides/launching-browsers.html#Browsers">these browsers</a> at the moment.</p><h3>Any Limitations?</h3><ul><li>Cypress commands run inside of a browser. This means means it makes it a little bit harder to communicate with the back end — like your server or database. You will not be able to connect or import those server-side libraries or modules directly.</li><li>There will never be support for multiple browser tabs.</li><li>You cannot use Cypress to drive two browsers at the same time.</li><li>At this moment Internet explorer and Safari doesn’t support Cypress. But it’s in their road-map.</li></ul><h3>Conclusion</h3><p>I am very impressed with where front-end testing has come with Cypress and even more excited to explore what else Cypress has to offer. Cypress has got rid of almost all the cons of Selenium and let’s any developer to get started with front-end, end to end testing within minutes.</p><p>To learn more about Cypress visit <a href="https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Cypress-Can-Be-Simple-Sometimes">Cypress Documentation.</a></p><h3>Honorable Mentions</h3><p><strong>Puppeteer -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/0*pqHdnZ4ZsOHiwHOR.png" /></figure><p>Puppeteer based on Node.js, was introduced by Chrome DevTools team to support fast headless/automated browser testing.</p><ul><li>Puppeteer needs to be integrated with a testing framework or assertion library like Jest, Chai, Sinon.</li><li>No support for cross-browser testing</li></ul><p><strong>Nightwatch.js -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*63vgaBRXBT9udfYt.png" /></figure><p>Nightwatch.js is an integrated, easy to use End-to-End testing solution for web applications written in Node.js.</p><ul><li>Simple but powerful syntax enables you to write tests very quickly.</li><li>Built-in command-line test runner can run the tests either sequentially or in parallel, together, by group, tags, or single.</li><li>Has an own testing framework and also support Mocha.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬<strong>.</strong></p><p><strong>To join our community Slack team chat </strong>🗣️ <strong>read our weekly Faun topics </strong>🗞️,<strong> and connect with the community </strong>📣<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6P3WpLjGv5v1ucm5dgkucg.png" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9532ee91575" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/automated-front-end-testing-for-developers-d9532ee91575">Automated front-end testing for Developers</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Restful APIs for WSO2 API Management]]></title>
            <link>https://faun.pub/restful-apis-for-wso2-api-management-de9228d9eb65?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/de9228d9eb65</guid>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[karate]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Sat, 09 Nov 2019 13:53:37 GMT</pubDate>
            <atom:updated>2019-11-11T14:26:27.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIaXwlDs5MJfRZYtX80cAg.jpeg" /></figure><p>WSO2 API Manager consist of a <strong>RESTful APIs</strong> that allows you to perform the same functions that can be performed with the API manager GUI.</p><p>This Rest APIs came in handy to automate smoke tests for platform verification and automating tests with secured APIs.</p><p>API manager consists of mainly 2 parts,</p><ul><li>API publisher</li><li>API Store</li></ul><p><strong>The API Life cycle I have followed to manage an API in WSO2 API Manager</strong></p><ol><li>Create an API in publisher</li><li>Publish the API in publisher</li><li>Create an Application in store</li><li>Subscribe Application to the API created</li><li>Generate the Access Token for the application</li><li>Test the target API with created access token</li><li>Remove the application</li><li>Delete the API</li></ol><p>In order to test above WSO2 API life cycle I have used <strong>Karate</strong> as my testing framework. Karate is a test automation framework created to make your web-services testing simple and it uses predefined, self-explanatory Gherkin steps to write test cases. To get started with karate please refer my previous post, <a href="https://medium.com/@snironr/kick-off-web-services-testing-with-karate-a62834c91dea?source=friends_link&amp;sk=fda12fd81d84f4ac2777159d0a0905d6">Kick off Web services testing with KARATE.</a></p><p><a href="https://docs.wso2.com/display/AM260/WSO2+API+Manager+Documentation">WSO2 API-M Version : 2.6.0</a></p><p><strong><em>Step 1</em>-</strong> In order to create an API in publisher you need to generate Consumer Credentials for the API publisher. Header Authorization has username and the password of publisher encoded in base64.</p><pre> Given url amBaseUrl<br> And path ‘/client-registration/v0.14/register’<br> And header Content-Type = ‘application/json’<br> And header Authorization = call read(‘json/basic-auth.js’) {username: ‘#(amUsername)’, password: ‘#(amPassword)’}<br> And request read(‘json/publisher_request_body.js’)<br> When method post<br> Then status 200<br> * def publisherConsumerKey = response.clientId<br> * def publisherConsumerSecret = response.clientSecret</pre><pre>Request payload :<br>{<br> “callbackUrl”: “<a href="http://www.google.lk/">www.google.lk</a>&quot;,<br> “clientName”: “rest_api_publisher”,<br> “owner”: “admin”,<br> “grantType”: “password refresh_token”,<br> “saasApp”: true<br>}</pre><p><strong><em>Step 2 </em>-</strong> Using the received client Id and client Secret, Generate access token to create API. Note that the scope is set to <em>“apim:api_create”</em></p><pre>Given url accessTokenUrl<br>And path ‘token’<br>And header Authorization = call read(‘json/basic-auth.js’) {username: ‘#(publisherConsumerKey)’, password: ‘#(publisherConsumerSecret)’}<br>And form field grant_type = ‘password’<br>And form field username = amUsername<br>And form field password = amPassword<br>And form field scope = &#39;apim:api_create&#39;<br>When method post<br>Then status 200<br>* def AccessToken = response.access_token</pre><p><strong><em>Step 3 -</em></strong><em> </em>API creation post request specifying the details of the API in the <a href="https://docs.wso2.com/display/AM260/apidocs/publisher/index.html#!/operations#APIIndividual#apisPost">payload</a>. Here we use the access token generated in the <em>step 2.</em> Response body will contain the UUID of the created API and we are going to assign that to a variable for later use.</p><pre>Given url amBaseUrl<br>And path ‘api/am/publisher/v0.14/apis’<br>And header Content-Type = ‘application/json’<br>And header Authorization = ‘Bearer ‘+AccessToken<br>And request read(‘json/create_api_request_body.js’)<br>When method post<br>Then status 201<br>* def apiUUID = response.id</pre><p><em>payload specifying the API :</em></p><pre>{<br> “name”: “platform-verification-API”,<br> “description”: “”,<br> “context”: “/testResource”,<br> “version”: “1.0.0”,<br> “provider”: “admin”,<br> “apiDefinition”: “{\”swagger\”:\”2.0\”,\”paths\”:{\”\/posts/1\”:{\”get\”:{\”responses\”:{\”200\”:{\”description\”:\”\”}},\”x-auth-type\”:\”Application &amp; Application User\”,\”x-throttling-tier\”:\”Unlimited\”}}},\”info\”:{\”title\”:\”WorldBank\”,\”version\”:\”1.0.0\”}}”,<br> “wsdlUri”: null,<br> “status”: “CREATED”,<br> “responseCaching”: “Disabled”,<br> “cacheTimeout”: 300,<br> “destinationStatsEnabled”: null,<br> “isDefaultVersion”: false,<br> “type”: “HTTP”,<br> “transport”: [<br> “http”,<br> “https”<br> ],<br> “tiers”: [“Unlimited”],<br> “maxTps”: {<br> “sandbox”: 5000,<br> “production”: 1000<br> },<br> “thumbnailUri”: null,<br> “visibility”: “PUBLIC”,<br> “visibleRoles”: [],<br> “endpointConfig”: “{\”production_endpoints\”:{\”url\”:\”<a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com\</a>”,\”config\”:null},\”sandbox_endpoints\&quot;:{\&quot;url\&quot;:\&quot;<a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com\</a>&quot;,\&quot;config\&quot;:null},\&quot;endpoint_type\&quot;:\&quot;http\&quot;}&quot;,<br> “gatewayEnvironments”: “Production and Sandbox”,<br> “subscriptionAvailability”: null,<br> “subscriptionAvailableTenants”: [],<br> “corsConfiguration”: {<br> “accessControlAllowOrigins”: [“*”],<br> “accessControlAllowHeaders”: [<br> “authorization”,<br> “Access-Control-Allow-Origin”,<br> “Content-Type”,<br> “SOAPAction”<br> ],<br> “accessControlAllowMethods”: [<br> “GET”<br> ],<br> “accessControlAllowCredentials”: false,<br> “corsConfigurationEnabled”: false<br> }<br>}</pre><p><strong><em>Step 4</em></strong> - Generate access token to publish API. The API we just created in the <em>Step 3 </em>is still CREATED state. We are going to publish it. Prior to that we need the access token to publish.</p><p>Follow step 2, just need to set the scope as below.</p><pre>scope = &#39;<em>apim:api_publish&#39;</em></pre><p><strong><em>Step 5 </em></strong>- Publish the API</p><pre>Given url amBaseUrl<br>And path ‘/api/am/publisher/v0.14/apis/change-lifecycle’<br>And header Content-Type = ‘application/json’<br>And header Authorization = ‘Bearer ‘+AccessToken<br>And param apiId = apiUUID<br>And param action = ‘Publish’<br>And request ‘’<br>When method post<br>Then status 200</pre><p><strong><em>Step 6 </em></strong><em>- G</em>enerate Consumer Credentials for the API Store just as we did for publisher (<em>Step 1</em>). Use the login credentials for the store and in the payload of the post body, set clientName to<em> ‘rest_api_store’</em> instead of ‘<em>rest_api_publisher’. This step can be skipped if the user you are using has access to both store and publisher.</em></p><p><strong><em>Step 7 - </em></strong>Generate application create access token</p><p>Follow step 2, Use the consumer credentials generated for the store and just need to set the scope as below.</p><pre>scope = ‘apim:subscribe’</pre><p><strong><em>Step 8 - </em></strong>Create a new application in store</p><pre>Given url amBaseUrl<br>And path ‘api/am/store/v0.14/applications’<br>And header Authorization = ‘Bearer ‘+AccessToken<br>And request read(‘json/create_application_request_body.js’)<br>When method post<br>Then status 201<br>* def applicationID = response.applicationId</pre><pre>Request Payload : <br>{<br> “throttlingTier”: “Unlimited”,<br> “description”: “Platform verification app description”,<br> “name”: “platform-verification-app”,<br> “callbackUrl”: “<a href="http://my.server.com/callback">http://my.server.com/callback</a>&quot;,<br> “groupId”: “org1”<br>}</pre><p><strong><em>Step 9 - </em></strong>Create a new application in store</p><pre>Given url amBaseUrl<br>And path ‘api/am/store/v0.14/subscriptions’<br>And header Authorization = ‘Bearer ‘+AccessToken<br>* def subscriptionBody = read(‘json/create_new_subscription.js’)<br>* set subscriptionBody.apiIdentifier = apiUUID<br>* set subscriptionBody.applicationId = applicationID<br>And request subscriptionBody<br>When method post<br>Then status 201</pre><pre>Request Payload :<br>{<br> “tier”: “Unlimited”,<br> “apiIdentifier”: “”,<br> “applicationId”: “”<br>}</pre><p><strong><em>Step 10 -</em></strong><em> </em>We are almost there! Let’s create application token.</p><pre>Given url amBaseUrl<br>And path ‘api/am/store/v0.14/applications/generate-keys’<br>And param applicationId = applicationID<br>And header Authorization = ‘Bearer ‘+AccessToken<br>And request read(‘json/generate_application_key_request_body.js’)<br>When method post<br>Then status 200<br>* def applicationAccessToken = response.token.accessToken</pre><pre>Request Payload :<br>{<br> “validityTime”: “3600”,<br> “keyType”: “PRODUCTION”,<br> “accessAllowDomains”: [ “ALL” ],<br> “scopes”: [ “am_application_scope”, “default” ],<br> “supportedGrantTypes”: [ “urn:ietf:params:oauth:grant-type:saml2-bearer”, “iwa:ntlm”, “refresh_token”, “client_credentials”, “password” ]<br>}</pre><p><strong><em>Step 11 - </em></strong><em>Voila! </em>Let’s make a get request to target API using generated access token</p><pre>Given url targetApiUrl<br>And path ‘testResource/1.0.0/posts/1’<br>And header Authorization = ‘Bearer ‘+applicationAccessToken<br>When method get<br>Then status 200</pre><p><strong><em>Step 12 - </em></strong>Delete the created application using access token generated with <em>scope = ‘apim:subscribe’</em></p><pre>Given url amBaseUrl<br>And path ‘api/am/store/v0.14/applications/’+applicationID<br>And header Authorization = ‘Bearer ‘+AccessToken<br>When method delete<br>Then status 200</pre><p><strong><em>Step 13 - </em></strong>Delete the created API using access token generated with <em>scope = ‘apim:api_create’</em></p><pre>Given url amBaseUrl<br>And path ‘api/am/publisher/v0.14/apis/’+apiUUID<br>And header Authorization = ‘Bearer ‘+AccessToken<br>When method delete<br>Then status 200</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/1*aE7CwhHw15KZxRNuHa4jMw.png" /></figure><p>Git repository with above karate tests : <a href="https://github.com/TheRasanjana/wso2-api-management">https://github.com/TheRasanjana/wso2-api-management</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de9228d9eb65" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/restful-apis-for-wso2-api-management-de9228d9eb65">Restful APIs for WSO2 API Management</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turn your automated API tests in to Performance tests]]></title>
            <link>https://faun.pub/turn-your-automated-api-tests-in-to-performance-tests-fbba5395a4a6?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbba5395a4a6</guid>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[restassured]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Sun, 20 Oct 2019 07:50:58 GMT</pubDate>
            <atom:updated>2019-10-21T11:58:50.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i5pedJDJJFS5tNzzDZWWnA.jpeg" /></figure><p>In this web services based present world, writing functional tests for APIs is something developers/testers go through in their day today life. In an agile environment this may take place at the very beginning of a sprint, but performance testing an API comes at the end, when system is ready to move to production. This will have a tendency to reveal performance issues at latter stage of development which will cost more to fix a performance issue.</p><p>So what if we can have API load tests running along with functional tests through out the development? Any drastic change in performance of the API can be noticed by doing so. In order to do that developers/testers will have to create performance tests just after creating functional tests. But creating load tests again with all the API definitions will be boring and a pain, and probably will take time.</p><blockquote>In my recent voyage of searching for ways to leverage the functional tests to be used as performance tests, I found following trick that will be helpful and probably will save lot of time.</blockquote><p>You have to follow 3 simple steps in order to achieve this.</p><p><strong>I. Configure existing API tests to use a local proxy server.</strong></p><p><strong>II. Record the local proxy with a Performance testing tool.</strong></p><p><strong>III. Edit the recorded tests and Execute.</strong></p><p>I will go through each of the above steps with different testing tools I have tried it with.</p><h3>Steps 1 :</h3><h4>Configure existing API tests to use a local proxy server.</h4><p><strong>Rest-assured :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*-R5wsuFh7OXh7p24uG3EHQ.png" /></figure><p>You can easily configure Rest-assured to use a proxy for a specific request as below.</p><pre>given().proxy(&quot;localhost&quot;, 8888)</pre><p>Or you can configure a proxy statically for all requests</p><pre>RestAssured.proxy(&quot;localhost&quot;, 8888);</pre><p><strong>POSTMAN:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*AMPJN6xNBigvHx8cELCqIA.png" /></figure><p>In order for your POSTMAN requests to use a proxy, go to settings -&gt; Proxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*GZVUiA9_Aa0NbK623UYoeQ.png" /></figure><p>Turn on Proxy configuration and set the proxy values</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*bfByR44U8AHMXc49FgOBTQ.png" /></figure><p><strong>SoapUI</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/175/1*pHC80TyCffJ9hl7R_lYH5w.jpeg" /></figure><p>Go to file -&gt; Preferences -&gt; Proxy settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*G4PTdzNF5Ci4e8akhywwaQ.png" /></figure><h3>Step 2 :</h3><h4>Record the local proxy with a Performance testing tool.</h4><p><strong>Jmeter :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*dDm2vMGAxYM-fI1PRH1C3w.png" /></figure><ol><li>Add a thread group.</li><li>Add and configure HTTP(S) Test Script Recorder</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*8ULrwEuR7NfHlldCK8rhSQ.jpeg" /><figcaption>Adding HTTP(S) Test Script Recorder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*Ia8OLmyDThbIrBF_shyyUg.png" /><figcaption>Setting the port and Target Controller</figcaption></figure><p>3. Click Start button and recording will start.</p><p>4. Run the target API functional test.</p><p>5. When test is done running, click stop button in recorder.</p><p><strong>Gatling :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*1CFE0lhAByd3wIVEslRSCA.jpeg" /></figure><p>Gatling also comes with a http proxy recorder. The steps to configure the recorder are same as in Jmeter.</p><ul><li>Make sure Recorder mode is set to “HTTP Proxy”.</li><li>Set the Listening port, package and Class Name.</li><li>Check the Follow Redirects?, Infer HTML resources?, Remove cache Headers? and Automatic Referers? options.</li><li>Select an output folder</li><li>Click on the <strong>Start</strong> button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CZX31BRxoswMNpucvgKf0g.png" /></figure><p>After recording is done click on the <strong>Stop &amp; Save</strong> button in the Gatling recorder window and it will close.</p><p>A recorder file named *.scala is created and saved to the given output directory. This scala script is automatically created after recording.</p><p>Check here for more about G<a href="https://gatling.io/docs/2.3/http/recorder/">atling tests and execution</a>.</p><h3>Step 3:</h3><h4><strong>Edit the recorded test in Jmeter and execute</strong></h4><p>Inside the thread Group you will find the nicely captured http requests. These will contain all the host details, parameters, body data, http header managers and even authorization manager if basic auth was used in the API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*VzL9faJYcpaVBNFV8IK4CQ.png" /><figcaption>two captured requests</figcaption></figure><p>Start by editing the http request name as by default it will contain the resource path of the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*sT30-oa83-ZmoANsz_6nzA.png" /><figcaption>Captured header manager. Only Authorization and Content-Type will be needed.</figcaption></figure><p>In the captured header managers you will notice there are some unwanted headers. Let’s remove them as well.</p><blockquote>THAT’S IT!</blockquote><p>Just add the thread properties as required, add the listener reports and Run the load tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*HSoas_g-XBNC5b2CfxK67A.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbba5395a4a6" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/turn-your-automated-api-tests-in-to-performance-tests-fbba5395a4a6">Turn your automated API tests in to Performance tests</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Karate - Cucumber Reports integration in Jenkins]]></title>
            <link>https://faun.pub/karate-cucumber-reports-integration-in-jenkins-3f0e617c8265?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f0e617c8265</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[karatê]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[reporting]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Thu, 17 Oct 2019 04:29:29 GMT</pubDate>
            <atom:updated>2019-10-17T22:32:10.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUbXB2kxEYGJooQVctl5mw.jpeg" /></figure><blockquote>In this post I will go through steps to integrate Cucumber reports in Jenkins for Karate tests. If you have not performed <a href="https://medium.com/@snironr/karate-integration-with-jenkins-672bbef741b9?source=friends_link&amp;sk=fa2d03c82c9d350a462a98f01f7901b3">karate — Jenkins integration</a>, please go through my previous post.</blockquote><p><strong>I. Install Cucumber Reports in Jenkins</strong><br>Go to Jenkins Dashboard -&gt;Manage Jenkins -&gt;Manage plugins -&gt;Available -&gt; Cucumber reports -&gt; Install</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*Nz_8Rqy9QbJWCC77DJOrXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*jNsdDh3jAZ3jgfiIGqFvJg.png" /></figure><p><strong>II. Add and Configure Plugin Once Installed</strong></p><ol><li>Go to the target Maven project</li></ol><p>2. Click on Configure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*-pYxV-f0kxwk3D_2FAlIjw.png" /></figure><p>3. Go down to Post-build Actions</p><p>Post-build Actions-&gt; Add Post-build Actions -&gt; Cucumber Reports -&gt; Advanced</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*k6DNgeoeEtVUvmW9MWDInQ.png" /></figure><p>4. Set the following values</p><ul><li>Json Report Path : <em>target/surefire-reports</em></li><li>File Include pattern : <em>*.json</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*GENtnhVxynol5QxxiLMv9w.png" /></figure><p><strong>III. Add Cucumber reporting dependency in to pom.xml</strong></p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;net.masterthought&lt;/groupId&gt;<br>    &lt;artifactId&gt;cucumber-reporting&lt;/artifactId&gt;<br>    &lt;version&gt;3.8.0&lt;/version&gt;<br>    &lt;scope&gt;test&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p><strong>IV. Create a Parallel Runner class that generates the reports</strong></p><pre>import com.intuit.karate.KarateOptions;<br>import com.intuit.karate.Results;<br>import com.intuit.karate.Runner;<br>import net.masterthought.cucumber.Configuration;<br>import net.masterthought.cucumber.ReportBuilder;<br>import org.apache.commons.io.FileUtils;<br>import org.junit.Test;</pre><pre>import java.io.File;<br>import java.util.ArrayList;<br>import java.util.Collection;<br>import java.util.List;</pre><pre>import static junit.framework.TestCase.assertTrue;</pre><pre><a href="http://twitter.com/KarateOptions">@KarateOptions</a>(tags = {&quot;~<a href="http://twitter.com/ignore">@ignore</a>&quot;}) <br>public class TestParallel {<br>    <br><a href="http://twitter.com/Test">@Test</a><br>public void testParallel() {<br>System.setProperty(&quot;mock.env&quot;, &quot;karateTesting&quot;); // ensure reset if other tests (e.g. mock) had set env in CI<br>Results results = Runner.parallel(getClass(), 5);<br>TestParallel.generateReport(results.getReportDir());<br>assertTrue(results.getErrorMessages(), results.getFailCount() == 0);}</pre><pre>public static void generateReport(String karateOutputPath) {<br>Collection&lt;File&gt; jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {&quot;json&quot;}, true);<br>List&lt;String&gt; jsonPaths = new ArrayList(jsonFiles.size());<br>jsonFiles.forEach(file -&gt; jsonPaths.add(file.getAbsolutePath()));<br>Configuration config = new Configuration(new File(&quot;target&quot;), &quot;karateTesting&quot;);<br>ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);<br>reportBuilder.generateReports();<br>    }<br>}</pre><blockquote>Your Karate — Cucumber reports integration is good to go. Let’s <strong>Build Now.</strong></blockquote><blockquote>You can view generated Cucumber reports in the Project directory.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*e0TepY-l48C5whT_L7525w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*BJu5XRGUZOYZEi1MeOv04w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f0e617c8265" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/karate-cucumber-reports-integration-in-jenkins-3f0e617c8265">Karate - Cucumber Reports integration in Jenkins</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Karate integration with Jenkins]]></title>
            <link>https://faun.pub/karate-integration-with-jenkins-672bbef741b9?source=rss-81a44ee6299f------2</link>
            <guid isPermaLink="false">https://medium.com/p/672bbef741b9</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[karate]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Niron Rasanjana]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 06:44:17 GMT</pubDate>
            <atom:updated>2019-11-12T20:29:07.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIc22JgSuDd0X9KplAXj6w.jpeg" /></figure><p>Whatever project we are working on, over a period of time we end up having a large suite of tests that need to be run very often. To have tests running regularly, it is key that we integrate test suite execution with our Continuous Integration tool chain.</p><p>If you are new to API testing with karate you can go through my previous post-Kick-off<a href="https://medium.com/@snironr/kick-off-web-services-testing-with-karate-a62834c91dea?source=friends_link&amp;sk=fda12fd81d84f4ac2777159d0a0905d6"> web services testing with Karate</a>. That will be sufficient to get you started with karate.</p><p>In this post, I will walk you through karate -Jenkins integration in few easy steps.</p><h4><strong>I</strong>. Install Maven in Jenkins</h4><ol><li>Go to Jenkins Dashboard -&gt;Manage Jenkins -&gt;Manage plugins -&gt;Available -&gt;Maven Integration plugin -&gt;Install</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*8_TkrXBdaoXd8Fltly8Bgg.png" /></figure><p>2. Go to Jenkins Dashboard -&gt; New Item -&gt; Maven Project option will be available</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*uUhvUvhZoh-qbd0lzY-8Xw.png" /></figure><h4>II. Create a Maven project</h4><p>Go to Jenkins Dashboard -&gt; New Item -&gt; Choose name for the Maven Project (e.g. KarateMavenExample)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*GsEidWpUYeXBoukZnPh73g.png" /></figure><h4>III. Configure Maven project</h4><p>In Configure Page, do the following changes</p><p>1. Discard Old builds</p><p>-Days to keep builds: 7</p><p>-Max no. of builds to keep: 15</p><p>2. Build -&gt; advanced -&gt; enable the following</p><p>-Resolve Dependencies during Pom parsing</p><p>-Use custom workspace (add path of the folder containing pom.xml)</p><p>-Goals &amp; Options = Clean test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*hSbsHPvIWr5iScAShtyyKw.png" /></figure><p>If you have different environments configured in karate-config.js, you can use the “Goals &amp; Options” to choose the environment you want to run in.</p><p>e.g : test -DargLine=&quot;-Dkarate.env=UAT&quot;</p><p>3. Apply &amp; Save</p><h4>IV. Go to Project Window and Click ‘Build Now’.</h4><p>Go to ‘Console Output’ and now you can see the test results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*JKvOTAkKuY9dfKTSR0c8UQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=672bbef741b9" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/karate-integration-with-jenkins-672bbef741b9">Karate integration with Jenkins</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>