<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: E Elkan</title>
    <description>The latest articles on DEV Community by E Elkan (@em_elkan).</description>
    <link>https://dev.to/em_elkan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F189522%2Fc74d6235-58bc-4ed8-a540-0f337b2f6d82.jpg</url>
      <title>DEV Community: E Elkan</title>
      <link>https://dev.to/em_elkan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/em_elkan"/>
    <language>en</language>
    <item>
      <title>API Testing with Postman</title>
      <dc:creator>E Elkan</dc:creator>
      <pubDate>Sat, 01 Feb 2020 14:43:45 +0000</pubDate>
      <link>https://dev.to/em_elkan/api-testing-with-postman-1fgp</link>
      <guid>https://dev.to/em_elkan/api-testing-with-postman-1fgp</guid>
      <description>&lt;p&gt;Recently I've been learning all about API testing with Postman. I've put together a small collection of my favourite tutorials and practice API's for anyone else who is new to API testing and wants to learn more.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Postman?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.getpostman.com/"&gt;Postman&lt;/a&gt; is currently one of the most popular tools used in API testing. It's free for individuals and small teams with wide support for all API types. It can be used for &lt;a href="https://www.getpostman.com/use-cases/exploratory-testing"&gt;exploratory testing&lt;/a&gt; and &lt;a href="https://www.getpostman.com/automated-testing"&gt;automated testing&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tutorials
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://learning.getpostman.com/?_ga=2.97498591.151621366.1577222241-1815186062.1576190324"&gt;The Postman Learning Center&lt;/a&gt;&lt;br&gt;
&lt;a href="https://testautomationu.applitools.com/exploring-service-apis-through-test-automation/"&gt;Exploring Service APIs Through Test Automation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://blog.getpostman.com/2017/07/28/api-testing-tips-from-a-postman-professional/"&gt;API - Testing Tips from a Postman Professional&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/distant-horizons/testing-apis-with-postman-10-common-challenges-solutions-c4674c78528d"&gt;Testing APIs with Postman: 10 common challenges &amp;amp; solutions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Practice API's
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://pokeapi.co/"&gt;PokéAPI&lt;/a&gt;&lt;br&gt;
&lt;a href="https://restful-booker.herokuapp.com/"&gt;Restful-Booker&lt;/a&gt;&lt;br&gt;
&lt;a href="https://jsonplaceholder.typicode.com/"&gt;JSON Placeholder&lt;/a&gt;&lt;br&gt;
&lt;a href="https://swapi.co/"&gt;The Star Wars API&lt;/a&gt;&lt;br&gt;
&lt;a href="https://rickandmortyapi.com/"&gt;Rick and Morty API&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Code Snippets
&lt;/h3&gt;

&lt;p&gt;Check Status code is 200:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check response time is below 300ms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.test("Response time is less than 300ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(300);
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check a value is true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.test("Check Connected is true", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.Connected).to.eql(true);
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check values within an array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.test("First group in list is Test 1", function () {
    var json = pm.response.json();
    pm.expect(json[0].Name).to.eql("Test 1");
    pm.expect(json[0].State).to.eql(3);
    1pm.expect(json[0].Type).to.eql(1);
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check nested values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.test("Check ability is torrent", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.abilities[0].ability.name).to.eql("torrent");
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Newman
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://learning.postman.com/docs/postman/collection-runs/command-line-integration-with-newman/"&gt;Newman&lt;/a&gt; allows you to run and test a Postman collection directly from the command line. Newman can be used for continuous integration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hzcWuN3W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://emelkan.netlify.app/images/newman.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hzcWuN3W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://emelkan.netlify.app/images/newman.gif" alt="newman.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Postman Alternatives
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.soapui.org/"&gt;soapUI&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/liyasthomas/postwoman"&gt;Postwoman&lt;/a&gt;&lt;br&gt;
&lt;a href="https://insomnia.rest/"&gt;Insomnia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cover image: &lt;a href="https://icons8.com/"&gt;https://icons8.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>testing</category>
      <category>api</category>
      <category>postman</category>
    </item>
  </channel>
</rss>
