<?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 Nitin Verma on Medium]]></title>
        <description><![CDATA[Stories by Nitin Verma on Medium]]></description>
        <link>https://medium.com/@ntn-verma1?source=rss-12ceb6a96118------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hO4atUUSTSCp0GuJ_FDP8g.jpeg</url>
            <title>Stories by Nitin Verma on Medium</title>
            <link>https://medium.com/@ntn-verma1?source=rss-12ceb6a96118------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:55:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ntn-verma1/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[End to end automation testing of Alexa Skill (conversational AI testing)]]></title>
            <link>https://ntn-verma1.medium.com/end-to-end-automation-testing-of-alexa-skill-conversational-ai-testing-118c9001d3df?source=rss-12ceb6a96118------2</link>
            <guid isPermaLink="false">https://medium.com/p/118c9001d3df</guid>
            <category><![CDATA[conversational-ai-testing]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[ai-and-machine-learning]]></category>
            <category><![CDATA[alexa-skill-set-testing]]></category>
            <dc:creator><![CDATA[Nitin Verma]]></dc:creator>
            <pubDate>Wed, 09 Jun 2021 22:32:12 GMT</pubDate>
            <atom:updated>2021-06-09T23:20:59.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing has evolved a lot over many years for all the traditional software but there’s no doubt that AI is a hot topic. All the popular sectors are now focusing on improving their customer services with AI integration to their products and services and targeting wider scope with different AI channels like Chatbot, Virtual Assistant, Voice Assistant etc.</p><p>Like other software and its testing, Conversational AI automation testing is also possible and many of them are available open-source along with few paid solutions.</p><p>In the first place, AI is new to many industries where Shift left and early automation implementation becomes important in order to successfully product.</p><p>Despite the varied activity in this space, AI is still in an exploratory phase and largely an untested customer value proposition. As people start to feel more at ease with the technology, designers need to pay greater attention to how AI fits into the wider guest experience. There are key design considerations we expect to surface for automation with this emerging technology.</p><p><strong>What is Conversational AI?</strong></p><p>Conversational AI is the technology that ultimately enables machines to naturally interact with humans via language. It is a subset of artificial intelligence that leverages concepts like neural networks, machine learning and others. And make them available to build useful applications with it like hands-free control while you are driving or at home, Alexa waiting for your command or even virtual agents that assist in customer support over phone.</p><p><strong>How does it work?</strong></p><p>Conversational AI is a fusion of various technologies like Automated Speech Recognition (ASR), ML, natural language processing (NLP) and Natural Language Understanding (NLU), which process every written or spoken word and check out the best way to respond and grasp from every user interaction.</p><p><strong>Conversational AI flow is sliced into three sections:</strong></p><p>· Automatic Speech Recognition (ASR)</p><p>· Natural Language Processing (NLP) or Natural Language Understanding (NLU)</p><p>· Text-to-Speech (TTS)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VDVum_on8juUPpQeKkKLQ.png" /><figcaption>Conversational flow</figcaption></figure><p><strong>What are Alexa skills?</strong></p><p>As we have apps for smartphones, similarly for Alexa devices we have skills which can be enabled and disabled from Alexa apps.</p><p><strong>Keywords in Alexa skill kit:</strong></p><ul><li><strong>Wakeword:</strong> The Echo devices have a ring of always-on microphones, meaning the device is always in listening mode. It will only ‘wake up’ and actively pay attention to you when it hears a specific word or phrase, called a wakeword</li></ul><p>- For Alexa: Alexa, Echo, Computer are wakewords</p><p>- For Google assistant: Ok Google</p><ul><li><strong>Invocation Name:</strong> An ‘invocation name’ is the word or phrase used to trigger your skill. For example</li></ul><p>- Alexa, play music</p><p>- Alexa, ask doctor connect</p><ul><li><strong>Intent:</strong> An intent is what a user is trying to accomplish</li><li><strong>Utterance:</strong> Utterances are the specific phrases that people will use when making a request to a voice app or Alexa</li><li><strong>Slots:</strong> A slot is a variable that relates to an intent allowing Alexa to understand information about the request</li></ul><p><strong>Utterance example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOjvPrGe2u3ihil9sViSfg.png" /><figcaption>Utterance Example</figcaption></figure><p>So far, I have 3 different successful POC done on Conversational AI automation.</p><ol><li>Botium Connector for Amazon Alexa Skills Management API</li><li>Botium alexa avs connector</li><li>Custom framework/tool to test end to end Alexa skills</li></ol><p>Broadly I will be taking each of them one by one.</p><p><strong>AUT Summary:</strong></p><p>Custom Alexa skill Doctor Appointment is created, this helps users to book an appointment with a doctor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TEwa4-MS44hA-zwQdZuuw.png" /><figcaption>Custom Skill</figcaption></figure><p><strong>Botium Connector for Alexa Skills Management API(SMAPI):</strong></p><p>This verifies the utterance mapped with each intents. Using this once can test Alexa skill programmatically instead of testing it through Alexa Skills Kit developer console.</p><ul><li>It uses Skill Invocation API, to invoke your application for testing purpose</li><li>Skill Simulation API, helps to test skill and see the intent that a simulated device returns from your interaction model</li></ul><p><strong>Demo:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCnrdJeehkxA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCnrdJeehkxA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCnrdJeehkxA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3afd06c40be59cb67e1492677c2e995a/href">https://medium.com/media/3afd06c40be59cb67e1492677c2e995a/href</a></iframe><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgLfwkSpRS7kNnwMBr95Gg.png" /><figcaption>Automation execution report</figcaption></figure><p><strong>Tools and technology:</strong></p><ul><li>NodeJs, AVS, SMAPI, Mocha</li></ul><p><strong>Botium Connector for Amazon Alexa with AVS:</strong></p><p>This tool can be used to test Alexa skills. For this one has to register a virtual Alexa device in the Alexa voice service (AVS) portal. This Works the same way as a physical Alexa device. It is not bound to any Alexa Skill, so you have to activate your Alexa skill with its activation utterance. Like “<strong>Alexa, order a pizza</strong>”</p><p>For single level conversation it will be flawless for example “<strong>Alexa, turn light on</strong>”. But when it comes to test multilevel conversation like in this case (Doctor connect skills) it fails, as it validates the Alexa response at every step. Whereas Alexa waits for user input for 8 seconds which is a default time of it. If the user fails to respond, the skills session will expire and Alexa will be out of context of the skill.</p><p><strong><em>Notes:</em></strong><em> Botium AVS connector is not meant to handle multilevel conversation, as Alexa moves out of context when the transcribe job is in process.</em></p><p><em>So I raised an issue — </em><a href="https://github.com/codeforequity-at/botium-bindings/issues/124"><strong><em>https://github.com/codeforequity-at/botium-bindings/issues/124</em></strong></a><em> on githhub which is maintained by Florian Treml a Co-Founder and CTO of Botium. And what was his response.</em></p><p>It’s an appreciation for me. Thank you Florian Treml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_ZLLCt0QiSDhH8SyAY78Q.png" /></figure><p><strong>Demo:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3Gh1-pNAdYk&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3Gh1-pNAdYk&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F3Gh1-pNAdYk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/88872f642e5c9d4942b605e18590ea27/href">https://medium.com/media/88872f642e5c9d4942b605e18590ea27/href</a></iframe><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tuE1x6in1I1tdMbBXgl06A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlS51rmRFhfHnul7nyHv4g.png" /><figcaption>Execution report and console logs</figcaption></figure><p><strong>Tools and technology:</strong></p><ul><li>NodeJs, AVS, AVS-connector, AWS Polly, transcribe, Mocha.</li></ul><p><strong>Custom Framework:</strong></p><p>I have created a custom tool and framework for testing the Alexa skill of multi level conversation end to end.<br>To make it workable you need to register a new product in the Alexa Voice Service console. This registered product will work the same as the Alexa device. It is not restricted to any Alexa Skill and can be invoked by invocation name. Using this framework you can test production skills as well.</p><p><strong>How does it work?</strong></p><ul><li>Utterances are converted from text to speech into .mp3 file using Amazon Polly</li><li>Converted .mp3 is then feed to Alexa Voice Service (AVS) via Alexa client and returns the Alexa response in same format i.e .mp3</li><li>Then output response is converted into .wav file using ffmpeg and stored in S3 bucket</li><li>Finally AWS Transcribe turns the stored .wav file into text. Which is then verified with the expected response text</li></ul><p><strong>Workflow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPVZ3q0aedbI_IIG2q_t8Q.png" /><figcaption>Framework flow</figcaption></figure><p><strong>Demo:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHFw0AU3yyuM&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHFw0AU3yyuM&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FHFw0AU3yyuM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f46deba8dfe5098adffc73bdeac6bcb/href">https://medium.com/media/0f46deba8dfe5098adffc73bdeac6bcb/href</a></iframe><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cP0tmdEd-wrIRj2VHI2hbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HKoaQtPlbWOv3RYrJhGUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0BQ7Iy7Y7DWV6bIziLJjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAXdajqubGPINX9O5pryEg.png" /><figcaption>Execution report of custom framework</figcaption></figure><p><strong>Tools and technology:</strong></p><ul><li>Programming Language: Python 3.9</li><li>Test Framework: Pytest</li><li>Libraries: Boto3(python SDK for AWS), ffmpeg, Alexa client</li><li>AWS services: Amazon Polly, S3, Transcribe</li><li>Alexa Voice Service (AVS)</li><li>FastAPI and jinja2 template for UI</li></ul><p><strong>References:</strong></p><ul><li>Images — <a href="https://www.google.com/">https://www.google.com/</a></li><li><a href="https://botium-docs.readthedocs.io/en/latest/">https://botium-docs.readthedocs.io/en/latest/</a></li><li><a href="https://www.npmjs.com/package/botium-connector-alexa-smapi">https://www.npmjs.com/package/botium-connector-alexa-smapi</a></li><li><a href="https://github.com/codeforequity-at/botium-connector-alexa-avs">https://github.com/codeforequity-at/botium-connector-alexa-avs</a></li><li><a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">https://boto3.amazonaws.com/v1/documentation/api/latest/index.html</a></li><li><a href="https://aws.amazon.com/polly/">https://aws.amazon.com/polly/</a></li><li><a href="https://docs.aws.amazon.com/transcribe/latest/dg/what-is-transcribe.html">https://docs.aws.amazon.com/transcribe/latest/dg/what-is-transcribe.html</a></li><li><a href="https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/get-started-with-alexa-voice-service.html">https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/get-started-with-alexa-voice-service.html</a></li></ul><p><strong><em>Happy Learning!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=118c9001d3df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Raspberry Pi 3 based Android Tv automation using Appium.]]></title>
            <link>https://ntn-verma1.medium.com/raspberry-pi-3-based-android-tv-automation-using-appium-f57b11d4dc4?source=rss-12ceb6a96118------2</link>
            <guid isPermaLink="false">https://medium.com/p/f57b11d4dc4</guid>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[raspberry-pi-3]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Nitin Verma]]></dc:creator>
            <pubDate>Fri, 22 May 2020 07:37:39 GMT</pubDate>
            <atom:updated>2020-05-22T07:37:39.321Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post we will go through with raspberry pi 3 android Tv automation.</p><p><strong>What is Android TV?</strong></p><p><strong>Android TV</strong> is a version of the Android operating system designed for digital media players, set-top boxes, soundbars, and TVs and developed by Google. Users can stream content to TV via apps, both free and paid, using your internet connection. Android TV almost certainly supports it. Netflix, HBO Now, Showtime Anytime, YouTube, Spotify and Hulu.</p><p><strong>What is Raspberry pi?</strong></p><p>It’s a powerful credit-card sized single board computer can be used for many applications and supersedes the original Raspberry Pi Model B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*49h6-ZWM3Myhj9BDLCojdg.png" /><figcaption>Raspberry Pi 3 B</figcaption></figure><p>I have installed LineageOS on Raspberry Pi which gives the benefit of the Android operating system. And after connecting to the TV using HDMI cable and powered ON, android Tv will look like as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*o4Zt3HGOoE2ruR9hNAuUJA.png" /><figcaption>Raspberry pi 3 Android TV user interface</figcaption></figure><p>Generally Android TV app development is somewhat very similar to the Android mobile app development in some ways. For automating Android TV app we use any of the broadly available native frameworks for Android mobile testing.</p><p>· Appium</p><p>· Coffee</p><p>· Detox</p><p>· Calabash</p><p>· UI Automator</p><p>· Robotium</p><p><strong>How to automated Android TV using Appium?</strong></p><pre><em>protected static ThreadLocal&lt;AppiumDriver&gt; tlDriver = new ThreadLocal&lt;&gt;();</em></pre><pre><em>private static AndroidDriver androidDriver;</em></pre><pre><em>DesiredCapabilities capabilities = new DesiredCapabilities();</em></pre><pre><em>capabilities.setCapability(MobCapabilityType.PLATFORM_NAME.getValue(), Constants.ANDROID);<br> capabilities.setCapability(MobCapabilityType.PLATFORM_VERSION.getValue(), platformVersion);</em></pre><pre><em>capabilities.setCapability(MobCapabilityType.DEVICE_NAME.getValue(), deviceName);<br> capabilities.setCapability(MobCapabilityType.APP_ACTIVITY.getValue(), activityName);</em></pre><pre><em>capabilities.setCapability(MobCapabilityType.APP_PACKAGE.getValue(), packageName);<br>capabilities.setCapability(&quot;autoGrantPermissions&quot;, &quot;true&quot;);</em></pre><pre><em>capabilities.setCapability(MobCapabilityType.AUTOMATION_NAME.getValue(),&quot;UiAutomator2&quot;);<br><br>capabilities.setCapability(&quot;uiautomator2ServerInstallTimeout&quot;, 90000);</em></pre><pre><em>capabilities.setCapability(MobCapabilityType.NEW_COMMAND_TIMEOUT.getValue(), commandTimeOut);</em></pre><pre><em>capabilities.setCapability(&quot;noReset&quot;, true);</em></pre><pre><em>tlDriver.set(new AndroidDriver(new URL(&quot;http://127.0.0.1:&quot; + port + &quot;/wd/hub&quot;), capabilities));</em></pre><pre><em>androidDriver = (AndroidDriver) tlDriver.get();<br><br>tlDriver.get().manage().timeouts().implicitlyWait(implicitTimeOut, TimeUnit.SECONDS);</em></pre><p><strong>Below is the of video for end to end Test script execution.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIAaWHSzOmzs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIAaWHSzOmzs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIAaWHSzOmzs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/93cbbe5543625bb152f24ec9448653be/href">https://medium.com/media/93cbbe5543625bb152f24ec9448653be/href</a></iframe><p><strong>Execution extent report.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yQBnSwhcF5TD8Jr0Mg8LRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*9CNUyWXZ-2CjfwIZeAmB9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*IuazQQGle-rxzj_jea4WVw.png" /><figcaption>Extent report</figcaption></figure><p>Thank you!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f57b11d4dc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Automation using Postman and Newman, and it’s integration with Jenkins]]></title>
            <link>https://ntn-verma1.medium.com/api-automation-using-postman-and-newman-and-its-integration-with-jenkins-c23de17069fd?source=rss-12ceb6a96118------2</link>
            <guid isPermaLink="false">https://medium.com/p/c23de17069fd</guid>
            <dc:creator><![CDATA[Nitin Verma]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 09:25:38 GMT</pubDate>
            <atom:updated>2020-04-15T09:25:38.001Z</atom:updated>
            <content:encoded><![CDATA[<p>As you all are aware with the current situation of COVID-19, today utmost important thing is testing. It’s hardly matter how strong you are unless and until your immune system is strong.</p><p>Similarly in the software development cycle, testing plays a number of vital roles in delivering quality software. How strong your application’s UI is, it’s always depends on how robust application API’s are.</p><p>So whether it’s a virus or a bug, test early and test often.</p><p>Hello all my name is Nitin Verma and this walk through will show you how to create collection via <a href="https://www.getpostman.com/"><strong>Postman</strong></a> and run your API tests using <a href="https://www.npmjs.com/package/newman"><strong>Newman</strong></a> in Node and the command line and also will go through with the integration with <strong>Jenkins.</strong></p><p><strong>What is an API?</strong></p><p>API stands for <strong>A</strong>pplication <strong>P</strong>rogramming <strong>I</strong>nterface, which is used to stabilize the interaction between two different applications by using any mode of communication.</p><p><strong>Prerequisites:-</strong></p><p>1. Download, install and logged into postman using email id <a href="https://www.postman.com/downloads/"><em>https://www.postman.com/downloads/</em></a></p><p>2. Download and install nodejs <a href="https://nodejs.org/en/download/"><em>https://nodejs.org/en/download/</em></a></p><p>3. Download and install Jenkins <a href="https://jenkins.io/download/"><em>https://jenkins.io/download/</em></a></p><ol><li><strong>Creating collection and writing test case</strong></li></ol><ul><li>Launch postman application, Click on + New Collection icon</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*5NfsssBKdQMGCjqaHDoCyw.jpeg" /></figure><ul><li>Provide name and description to your collection. Click Create button</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*2TmSYFd4vOE1qBhThAsnxQ.jpeg" /></figure><ul><li>Click on 3 dots to view more action</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*CuT-yz9ybKwCcf2bzNeR5Q.jpeg" /></figure><ul><li>Add request to your collection. Click on Add request</li><li>Provide name to your request</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*-QlBKExckWeqxm9Bx577FQ.jpeg" /></figure><ul><li>Provide name to your request and save it</li><li>Open your collection and click on added request</li><li>Enter request URL Eg: <a href="https://www.google.com/">https://www.google.com/</a></li><li>Navigate to Test option and click on Status code: Code is 200 from SNIPPET panel. Javascript call back function will be added</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*K8Wx6sycu2xLByIfTV0eyg.jpeg" /></figure><ul><li>Click save and execute the request by clicking Send</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*VAT4Ze7EMfutd1UZN2xkcA.jpeg" /></figure><p>Bingo you have created your first test case. Though SNIPPET provide you sample of test case (Javascript function), but still you require the basic knowledge of javascript call back function. Also you can test your javascript function using postman terminal (displayed on right hand corner at the bottom)</p><p><strong>2.</strong> <strong>Executing collection using NewmanCLI</strong></p><p>Before we start, first install Newman CLI</p><ul><li>Open command prompt</li><li>Command <em>npm install -g newman</em></li><li>Once installed you can check it’s version newman –version (Optional)</li></ul><p>There are 3 options to execute your API’s collection using Newman, first 2 options require manual intervention to get the collection.</p><p><strong><em>A. Option 1</em></strong></p><ul><li>Navigate to collection in postman, click on 3 dots and click on Export option. Pop will appear click on Export button and save your collection JSON in desired location.</li><li>Now Open Command prompt and execute the command</li></ul><p>— <strong>Command: <em>newman run &lt;Path of collection&gt;</em></strong></p><p>— <strong>Eg: </strong><em>newman run First_Collection.postman_collection.json</em></p><p>—<strong> Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fnY10HEV5HguMXYQ3T_vbg.jpeg" /></figure><ul><li>Execution report can be exported in different format like cli, junit, JSON and html</li><li>To export html report</li></ul><p>a. Install html report package: <em>npm install -g newman-reporter-htmlextra</em></p><p>b. Create a folder where html report will be saved.</p><p><strong><em>Eg: </em></strong><em>C:/Postman_Automation</em></p><p><strong><em>Command: </em></strong><em>newman run &lt;Collection JSON&gt; — reporters cli,htmlextra — reporter-htmlextra-export “C:/Postman_Automation/report1.html”</em></p><p><strong>Execute: </strong><em>newman run First_Collection.postman_collection.json — reporters cli,htmlextra — reporter-htmlextra-export “C:/Postman_Automation/report1.html”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*dgPXwvTO74J4P1Xq-GhAcA.jpeg" /></figure><p><strong><em>B.</em></strong> <strong><em>Option 2</em></strong></p><ul><li>Navigate to collection in postman, click on arrow button, click on Share button</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*cQAwanLPHbhzuSk60MKUzw.jpeg" /></figure><ul><li>Click on Get public link, copy collection public link</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*giw6RuZeIMzoJ3PRiojvqw.jpeg" /></figure><ul><li>Now Open Command prompt and execute the command</li></ul><p><strong><em>Command: </em></strong><em>newman run &lt;Public link&gt; — reporters cli,htmlextra — reporter- htmlextra-export “C:/Postman_Automation/report1.html”</em></p><p><strong><em>Eg: </em></strong><em>newman run </em><a href="https://www.getpostman.com/collections/5d1b38f64537d15a89a9"><em>https://www.getpostman.com/collections/5d1b38f64537d15a89a9</em></a><em> — reporters cli,htmlextra — reporter-htmlextra-export “C:/Postman_Automation/report.html”</em></p><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WL1aCgmtF3zVg53C-yveDA.jpeg" /></figure><p><strong><em>C.</em></strong> <strong><em>Option 3</em></strong></p><p>As the collection is the snapshot of the instance. So every time we change the request or test cases in collection, we need to have updated JSON collection to run our automation (Option 1 and 2). But this require manual intervention whenever test case are changed or modified in every iteration of run.</p><p>In this option will use postman API to fetch our collection and execute it through newman.</p><ul><li>To generate collection URL please follow below steps</li></ul><p>a. Navigate to URL <a href="https://app.getpostman.com/dashboard/integrations">https://app.getpostman.com/dashboard/integrations</a> this will display your workspace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4COLdF77Y6duTD2X4Kbwrg.jpeg" /></figure><p>b. Click on “My Workspace” &gt; Integrations &gt; Browse Integrations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*2HVsSWiXKIB9D1a-BQYkPg.jpeg" /></figure><p>c. Click on Postman API</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*dLBKEQaZ7GnwELa81NtuCg.jpeg" /></figure><p>d. Click on “+ Generate API Key”, provide name to your key and click on Generate API key button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*FmSlyZNaitVA3OhqMIRSeA.jpeg" /></figure><p>e. Copy API key, Go to Postman create a request and click on Send button</p><p><strong><em>Request URL:</em></strong> <a href="https://api.getpostman.com/collections?apikey=$apiKey"><em>https://api.getpostman.com/collections?apikey=$apiKey</em></a></p><p><strong><em>Eg:</em></strong> <a href="https://api.getpostman.com/collections?apikey="><em>https://api.getpostman.com/collections?apikey=</em></a><em> PMAK-5e91f78bada68b00312381e0–83404a74cdfcf7feb8670313b16c0d689a</em></p><p>f. Collection will be displayed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*6jzXVALauQPX3Ov-_gQEkw.jpeg" /></figure><ul><li>Will Now Generate the URL for your collection which we will use in newman command</li></ul><p><strong><em>Request URL:</em></strong> <a href="https://api.getpostman.com/collections/$uid?apikey=$apiKey"><em>https://api.getpostman.com/collections/$uid?apikey=$apiKey</em></a></p><p><strong>Eg:</strong> <a href="https://api.getpostman.com/collections/11009173-95590b92-1a72-4db3-b661-09d0a83fe89b?apikey=PMAK-5e91fb81988efd004220efb2-a22f5381c92afe71bcec489de6f2840dd2"><em>https://api.getpostman.com/collections/11009173-95590b92-1a72-4db3-b661-09d0a83fe89b?apikey=PMAK-5e91fb81988efd004220efb2-a22f5381c92afe71bcec489de6f2840dd2</em></a></p><ul><li>Execute newman command in terminal</li></ul><p><strong><em>Command:</em></strong> <em>newman run &lt;Collection URL&gt; — reporters cli,htmlextra — reporter-htmlextra-export “C:/Postman_Automation/report1.html”</em></p><p><strong><em>Eg: </em></strong><em>newman run </em><a href="https://api.getpostman.com/collections/11009173-95590b92-1a72-4db3-b661-09d0a83fe89b?apikey=PMAK-5e91fb81988efd004220efb2-a22f5381c92afe71bcec489de6f2840dd2"><em>https://api.getpostman.com/collections/11009173-95590b92-1a72-4db3-b661-09d0a83fe89b?apikey=PMAK-5e91fb81988efd004220efb2-a22f5381c92afe71bcec489de6f2840dd2</em></a><em> — reporters cli,htmlextra — reporter-htmlextra-export “C:/Postman_Automation/report1.html”</em></p><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Z6L4_8U1VaPT_KT6OX42OQ.jpeg" /></figure><p><strong>3. API automation integration with Jenkins.</strong></p><ul><li>Launch Jenkins — <a href="http://localhost:8080/">http://localhost:8080/</a></li><li>Go To, Manage Jenkins &gt; Manage Plugin &gt; Available, search and install HTML Publisher plugin and JUnit Plugin and restart jenkins</li><li>Once Jenkins restarted, navigate to New Item</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*cZP3cM15j8odQx0NH9tq-g.jpeg" /></figure><ul><li>Name your project, click on Freestyle project &gt; Click OK button</li><li>Your project will be displayed on Jenkins dashboard</li><li>Navigate to your project &gt; Configure &gt; Build &gt; Add build Step &gt; Execute Windows batch command</li><li>Enter your newman command with was generated in Option 3, in command section</li></ul><p><strong><em>Command:</em></strong> <em>newman run &lt;Collection URL&gt; — reporters cli,junit,htmlextra — reporter-junit-export “newman/report.xml” -n 1 — reporter-htmlextra-export “newman/report.html”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*zLL_TeS4d9vsnLfQyNSGBw.jpeg" /></figure><ul><li>Navigate to Post-build Actions &gt; Add post-build action &gt; Publish HTML reports</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*lUfFn8X67UMS4VNH9xqQqQ.jpeg" /></figure><ul><li>Go to Add post-build action &gt; Publish JUnit test result report, provide Test report XMLs. Click on save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Im4GhcCLY4T_HFwJbTcXSw.jpeg" /></figure><ul><li>Click on Build Now to trigger execution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1wrM93yRJMxfwHtbXC0nIA.jpeg" /></figure><ul><li>Build To view Html report click on “HTML Report”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YaVAqMkqbXfT0-A5IKyQpw.jpeg" /></figure><p><strong><em>Note: If there is HTML format issue follow below steps</em></strong></p><p>1. Manage Jenkins → Script console</p><p>2. And type in the following command:</p><pre><em>System.setProperty(&quot;hudson.model.DirectoryBrowserSupport.CSP&quot;, &quot;&quot;)</em></pre><p>3. Then Press Run. if you get the output as ‘Result’, then rerun the build from your project and check HTML report format</p><p><strong>Demo Video</strong></p><p><a href="https://youtu.be/jyl2zaFjNGU">https://youtu.be/jyl2zaFjNGU</a></p><p><strong>Summary</strong></p><ul><li>Postman is one of the most popular tools used in API testing</li><li>It’s always recommended you create an account in Postman, so your collections are available online</li><li>You can provide parameter to your request in Postman</li><li>You can also create Tests to verify a postman request</li><li>Collections can be run using Newman</li><li>Accessibility, Use of Collections, Collaboration, Continuous Integration, are some of the Key features to learn in Postman</li></ul><p><strong><em>Reference</em></strong></p><ul><li><a href="https://www.postman.com/automated-testing"><em>https://www.postman.com/automated-testing</em></a></li><li><a href="https://www.npmjs.com/package/newman"><em>https://www.npmjs.com/package/newman</em></a></li><li><a href="https://www.npmjs.com/package/newman-reporter-htmlextra"><em>https://www.npmjs.com/package/newman-reporter-htmlextra</em></a></li><li><a href="https://jenkins.io/doc/"><em>https://jenkins.io/doc/</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c23de17069fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>