<?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: Daphné Hervé</title>
    <description>The latest articles on DEV Community by Daphné Hervé (@daphne_herve).</description>
    <link>https://dev.to/daphne_herve</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%2F1203422%2F307ffca2-4da1-4ed2-ad77-657c98adedc3.png</url>
      <title>DEV Community: Daphné Hervé</title>
      <link>https://dev.to/daphne_herve</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daphne_herve"/>
    <language>en</language>
    <item>
      <title>[Postman] The variables</title>
      <dc:creator>Daphné Hervé</dc:creator>
      <pubDate>Sat, 23 Mar 2024 11:22:47 +0000</pubDate>
      <link>https://dev.to/daphne_herve/the-variables-2ihb</link>
      <guid>https://dev.to/daphne_herve/the-variables-2ihb</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;From advanced to expert 
For developers and testers.  
         ---------          
Some great tutorials to get all the tips of Postman :
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51cb5xogk1qcj76fl6so.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51cb5xogk1qcj76fl6so.png" alt="Image description" width="453" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Number 2 : Let's continue the tutorials with the variables.&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
In the previous tutorial we written some javascript in the test section to get data from the console. Postman offer a storage feature for this data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;That means :&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we can use getter and setter inside postman&lt;/li&gt;
&lt;li&gt;we can reuse data for a request chain for e2e tests and automation&lt;/li&gt;
&lt;li&gt;We can secure bearer token as secret using the variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this tutorial we will use the free &lt;strong&gt;&lt;em&gt;API of national french repository of adresses&lt;/em&gt;&lt;/strong&gt; (--&amp;gt; &lt;a href="https://guides.etalab.gouv.fr/apis-geo/1-api-adresse.html"&gt;documentation - FR&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Create a new request and type this call :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api-adresse.data.gouv.fr/search/?q=8+rue+port
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to enter the adresse of your choice ;) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqleysgul4k9tva6cd491.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqleysgul4k9tva6cd491.png" alt="Image description" width="800" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the send button to submit the request and enjoy the 5 results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozmr00szz68qgt9i7yzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozmr00szz68qgt9i7yzd.png" alt="Image description" width="800" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, it's time to play with variables !&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Firstly&lt;/em&gt;&lt;/strong&gt; we will &lt;em&gt;iterate on the results&lt;/em&gt; to get each adresse name :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let adresses = pm.response.json()
adresses.features.forEach(adresse =&amp;gt; console.log(adresse.properties.label))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Submit the call and enjoy the results in the dev console :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ynl8p7fr4t2q2p9ri6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ynl8p7fr4t2q2p9ri6i.png" alt="Image description" width="718" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each adresse label is properly retrieved.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Secondly&lt;/em&gt;&lt;/strong&gt;, we will store the results in a &lt;strong&gt;&lt;em&gt;collection variable.&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let adresses = pm.response.json()
// Setter
pm.collectionVariables.set("adresse_label_variable", adresses.features[0].properties.label);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Super nice ! And we add a getter :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Getter
let firstAdresse = pm.collectionVariables.get("adresse_label_variable");
console.log('stored_variable', firstAdresse);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should be like this :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frju9jagampehfic7mnpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frju9jagampehfic7mnpa.png" alt="Image description" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well done ! We used &lt;strong&gt;&lt;em&gt;setter&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;getter&lt;/em&gt;&lt;/strong&gt; to store the first result and reuse it in a console.log&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Good to know :&lt;/em&gt;&lt;/strong&gt; collectionVariables is not the only way to store data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CollectionVariable = Manage data into the collection only&lt;/li&gt;
&lt;li&gt;EnvironmentVariables = You can reuse data from one collection to another&lt;/li&gt;
&lt;li&gt;GlobalVariables = Use it everywhere.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y2wpvx61v1v9rb59okg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y2wpvx61v1v9rb59okg.png" alt="Image description" width="613" height="445"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8e74ypkraerrkabw838b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8e74ypkraerrkabw838b.png" alt="Image description" width="583" height="541"&gt;&lt;/a&gt;&lt;br&gt;
(&lt;a href="https://learning.postman.com/docs/sending-requests/variables/#defining-collection-variables"&gt;Official Postman Documentation&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can find the environment on the right corner at the top :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F68q5l64mvz37992kwyss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F68q5l64mvz37992kwyss.png" alt="Image description" width="316" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;To see all your collectionVariables&lt;/em&gt;&lt;/strong&gt; go there :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4nwqjuaiwpqqi3r13x4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4nwqjuaiwpqqi3r13x4.png" alt="Image description" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To see the other variable types see here :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h08f57bscrx8im3ne5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h08f57bscrx8im3ne5o.png" alt="Image description" width="725" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In the next tutorial&lt;/em&gt; we will learn to use the &lt;br&gt;
&lt;strong&gt;&lt;em&gt;environmentVariables&lt;/em&gt;&lt;/strong&gt; and how to store secret data&lt;/p&gt;

&lt;p&gt;See all the official &lt;strong&gt;&lt;em&gt;postman documentation&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://learning.postman.com/docs/sending-requests/variables/"&gt;here&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Hope it helps ! &lt;br&gt;
&lt;strong&gt;&lt;em&gt;Daphné Hervé (API, monitoring and QA automation lover)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postman</category>
      <category>api</category>
      <category>cheatsheet</category>
      <category>javascript</category>
    </item>
    <item>
      <title>[Postman] The dev console</title>
      <dc:creator>Daphné Hervé</dc:creator>
      <pubDate>Sat, 23 Mar 2024 11:22:15 +0000</pubDate>
      <link>https://dev.to/daphne_herve/the-dev-console-iho</link>
      <guid>https://dev.to/daphne_herve/the-dev-console-iho</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;From advanced to expert 
For developers and testers.  
         ---------          
Some great tutorials to get all Postman tips :
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7keym61ik82plgcfkl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7keym61ik82plgcfkl9.png" alt="Image description" width="453" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Number 1 : we begin the tutorials with the dev console.&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
The console is very useful when you are coding your front or for testing purpose. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Breaking news - we will write some javascript inside !&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For this tutorial we will need the &lt;strong&gt;&lt;em&gt;dev console&lt;/em&gt;&lt;/strong&gt; itself just here :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgblsy050pf1jz0klr6vg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgblsy050pf1jz0klr6vg.png" alt="Image description" width="248" height="572"&gt;&lt;/a&gt;&lt;br&gt;
In the left corner on the bottom.&lt;/p&gt;

&lt;p&gt;And the &lt;strong&gt;&lt;em&gt;test tab&lt;/em&gt;&lt;/strong&gt; in the request part, just here :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5oxttd6zjqthyj2xg7s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5oxttd6zjqthyj2xg7s.png" alt="Image description" width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a &lt;strong&gt;&lt;em&gt;get&lt;/em&gt;&lt;/strong&gt; request to the free pokemon api without any parameters just this call :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://pokeapi.co/api/v2/pokemon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should be like that :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvln8r4yucjs6u7vkm47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvln8r4yucjs6u7vkm47.png" alt="Image description" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press the send button for &lt;strong&gt;&lt;em&gt;submitting&lt;/em&gt;&lt;/strong&gt; our request ! &lt;br&gt;
Alright, so far everything ok ! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6pmbc1adj2565a5vuen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6pmbc1adj2565a5vuen.png" alt="Image description" width="800" height="555"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Let's take a deeper look to our main subject by clicking the &lt;strong&gt;&lt;em&gt;console&lt;/em&gt;&lt;/strong&gt; button on the bottom&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdja2orb858ag056uunw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdja2orb858ag056uunw.png" alt="Image description" width="448" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the call informations are properly retrieved.&lt;br&gt;
&lt;em&gt;And so what ?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Wait a minute, I mentioned some &lt;strong&gt;&lt;em&gt;javascript&lt;/em&gt;&lt;/strong&gt;, let's go !&lt;br&gt;
Go to the test tab and write some js :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let pokemons = pm.response.json().results
pokemons.forEach(pokemon =&amp;gt; console.log(pokemon.name))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should seems like that :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92jy7zbx8u1mrt4z1rtr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92jy7zbx8u1mrt4z1rtr.png" alt="Image description" width="583" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the send button to see the result in the console !&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Awww wow !&lt;/strong&gt;&lt;/em&gt; We have it ! A wonderful pokemon list !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeclnziqxjjzqdc298ax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeclnziqxjjzqdc298ax.png" alt="Image description" width="716" height="693"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We achieve our &lt;strong&gt;&lt;em&gt;first goal&lt;/em&gt;&lt;/strong&gt; : Use the postman console for debugging or testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Additional tips&lt;/em&gt;&lt;/strong&gt; : you can clear the console on the right corner on bottom of postman. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8v58bpsa7lpc263b806.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8v58bpsa7lpc263b806.png" alt="Image description" width="393" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Next steps :&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning to use &lt;em&gt;variables&lt;/em&gt; to do something with the pokemon list or any data you get.&lt;/li&gt;
&lt;li&gt;Manage your &lt;em&gt;environnement&lt;/em&gt; and keep your infos &lt;em&gt;secret&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Go further in the &lt;em&gt;javascript methods&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Learn to use the &lt;em&gt;mock server&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Go deeper with the &lt;em&gt;automation&lt;/em&gt;
... and several very useful things ! &lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Hope it helps ! &lt;br&gt;
&lt;strong&gt;&lt;em&gt;Daphné Hervé (API, monitoring and QA automation lover)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postman</category>
      <category>api</category>
      <category>cheatsheet</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Test less and cover more with combinations using Pairwise and Pict</title>
      <dc:creator>Daphné Hervé</dc:creator>
      <pubDate>Mon, 11 Mar 2024 04:35:07 +0000</pubDate>
      <link>https://dev.to/daphne_herve/test-less-and-cover-more-with-combinations-using-pairwise-and-pict-4n10</link>
      <guid>https://dev.to/daphne_herve/test-less-and-cover-more-with-combinations-using-pairwise-and-pict-4n10</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Go straight to the point ! 
Test less and cover more, 
sounds good ! 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;When ?&lt;/strong&gt; You have a lot of data or different behaviors to test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who ?&lt;/strong&gt; For developers and testers who want to reduce their number of tests cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work ?&lt;/strong&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Pairwise testing is an effective test case generation technique that is based on the observation that most faults are caused by interactions of at most two factors. Pairwise-generated test suites cover all combinations of two therefore are much smaller than exhaustive ones yet still very effective in finding defects" &lt;br&gt;
(&lt;a href="https://www.pairwise.org/"&gt;Pairwise.org&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this post we will use &lt;a href="https://github.com/microsoft/pict"&gt;PICT&lt;/a&gt; to generate efficient combinations of data at entry point of your test cases. Pict is an open source CLI tool developed by Microsoft. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Form your own opinion&lt;/em&gt; by using this great &lt;strong&gt;online console&lt;/strong&gt; : &lt;a href="https://pairwise.yuuniworks.com/"&gt;https://pairwise.yuuniworks.com/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How to use ?&lt;/strong&gt;&lt;br&gt;
Download the Pict.exe and open a terminal. &lt;br&gt;
It's an .exe, so you need to be on the same folder or to indicate the right path to the  Pict.exe.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Pict&lt;/span&gt; &lt;span class="nx"&gt;my_file_to_combine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;txt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;Tips&lt;/em&gt;&lt;/strong&gt; : render the results in an external file instead of in the command line interface using a return function :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Pict&lt;/span&gt; &lt;span class="nx"&gt;my_file_to_combine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;txt&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;csv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📝 Pict is also available with a container image. Go to the README to have more infos : &lt;a href="https://github.com/microsoft/pict"&gt;README on github&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Imagine a &lt;strong&gt;database with CRUD authorizations combined with user rights&lt;/strong&gt;. You need to test if the action of the user properly depends on the right authorization. &lt;/p&gt;

&lt;p&gt;Some usual exemples :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reader can only see the user-infos-table&lt;/li&gt;
&lt;li&gt;contributor can create into the user-infos-table&lt;/li&gt;
&lt;li&gt;admin can also update the localization-table&lt;/li&gt;
&lt;li&gt;admin is authorized to delete / localization-table
... etc etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without the Pairwise method, we would need to do several iterations for this test to cover all the possibilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's try the Pairwise method ! Such of entries...&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;#############################################################&lt;/span&gt;
&lt;span class="c1"&gt;# User's access to your database&lt;/span&gt;
&lt;span class="c1"&gt;#############################################################&lt;/span&gt;

&lt;span class="na"&gt;userTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;reader, admin, contributor, editor&lt;/span&gt;

&lt;span class="na"&gt;accessTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;view, create, read, update, delete&lt;/span&gt;

&lt;span class="na"&gt;database name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;user-infos, localization&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;... give the followings results :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;userTypes   accessTypes   database name&lt;/span&gt;
&lt;span class="s"&gt;admin       read          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       delete        user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor create        user-infos&lt;/span&gt;
&lt;span class="s"&gt;admin       view          localization&lt;/span&gt;
&lt;span class="s"&gt;editor      create        localization&lt;/span&gt;
&lt;span class="s"&gt;reader      delete        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      view          user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor update        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      read          user-infos&lt;/span&gt;
&lt;span class="s"&gt;editor      delete        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      update        user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor view          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       create        localization&lt;/span&gt;
&lt;span class="s"&gt;contributor read          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       update        user-infos&lt;/span&gt;
&lt;span class="s"&gt;reader      view          localization&lt;/span&gt;
&lt;span class="s"&gt;contributor delete        localization&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seems like a .csv file. The first row is the header with all the entries we mentioned.&lt;/p&gt;

&lt;p&gt;Without the Pairwise method, in the following case we would need to do at least &lt;strong&gt;&lt;em&gt;32&lt;/em&gt;&lt;/strong&gt; iterations for this test to cover all the possibilities.&lt;/p&gt;

&lt;p&gt;With the Pairwise generation method we get &lt;strong&gt;&lt;em&gt;17&lt;/em&gt;&lt;/strong&gt; results. Amazing !&lt;/p&gt;

&lt;p&gt;Now we can add some additional &lt;em&gt;restrictions&lt;/em&gt; :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if [userTypes] = "reader" then ([accessTypes] = "view");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;#############################################################&lt;/span&gt;
&lt;span class="c1"&gt;# User's access to your database &lt;/span&gt;
&lt;span class="c1"&gt;#############################################################&lt;/span&gt;

&lt;span class="na"&gt;userTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;reader, admin, contributor, editor&lt;/span&gt;

&lt;span class="na"&gt;accessTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;view, create, read, update, delete&lt;/span&gt;

&lt;span class="na"&gt;database name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;user-infos, localization&lt;/span&gt;

&lt;span class="s"&gt;if [userTypes] = "reader" then ([accessTypes] = "view");&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the results are ...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;userTypes   accessTypes   database name&lt;/span&gt;
&lt;span class="s"&gt;admin       read          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       delete        user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor create        user-infos&lt;/span&gt;
&lt;span class="s"&gt;admin       view          localization&lt;/span&gt;
&lt;span class="s"&gt;editor      create        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      view          user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor update        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      read          user-infos&lt;/span&gt;
&lt;span class="s"&gt;editor      delete        localization&lt;/span&gt;
&lt;span class="s"&gt;editor      update        user-infos&lt;/span&gt;
&lt;span class="s"&gt;contributor view          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       create        localization&lt;/span&gt;
&lt;span class="s"&gt;contributor read          localization&lt;/span&gt;
&lt;span class="s"&gt;admin       update        user-infos&lt;/span&gt;
&lt;span class="s"&gt;reader      view          localization&lt;/span&gt;
&lt;span class="s"&gt;contributor delete        localization&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;More details here about the Pairwise combination method : &lt;a href="https://www.pairwise.org/"&gt;Pairwise.org&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You can find some useful examples of restriction in the &lt;a href="https://github.com/Microsoft/pict/blob/main/doc/pict.md"&gt;official documentation&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The time you &lt;strong&gt;win&lt;/strong&gt; with this Pairwise method is precious to any other test action ! Think about &lt;strong&gt;exploratory testing&lt;/strong&gt; !&lt;/p&gt;

&lt;p&gt;Hope it helps ! &lt;br&gt;
&lt;strong&gt;&lt;em&gt;Daphné Hervé (API, monitoring and QA automation lover)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>microsoft</category>
      <category>pairwise</category>
      <category>cli</category>
    </item>
    <item>
      <title>[Postman] Set random numbers in your test name</title>
      <dc:creator>Daphné Hervé</dc:creator>
      <pubDate>Mon, 11 Mar 2024 04:26:39 +0000</pubDate>
      <link>https://dev.to/daphne_herve/postman-set-random-number-in-your-test-name-1den</link>
      <guid>https://dev.to/daphne_herve/postman-set-random-number-in-your-test-name-1den</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Love sharing my best postman recipes, today a precious advice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To set &lt;strong&gt;dynamically&lt;/strong&gt; a variable in your test name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEST - &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{{$randomInt}}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will get &lt;strong&gt;random&lt;/strong&gt; value in the the name on the TSF report.&lt;/p&gt;

&lt;p&gt;Appreciate the result :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcofsw3gb10wlzai5wpzt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcofsw3gb10wlzai5wpzt.png" alt="Test result in the TSF report" width="666" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a lot of very useful value with the &lt;strong&gt;&lt;em&gt;Faker&lt;/em&gt;&lt;/strong&gt; library :&lt;br&gt;
&lt;code&gt;$timestamp&lt;/code&gt; or &lt;code&gt;$randomAlphaNumeric&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Take a look here for more details about all the ramdom value that you can use : &lt;a href="https://learning.postman.com/docs/writing-scripts/script-references/variables-list/#:~:text=The%20Faker%20library%20enables%20you,%2C%20%24guid%20or%20%24timestamp%20."&gt;Official documentation about this topic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope it's help ! &lt;br&gt;
&lt;strong&gt;&lt;em&gt;Daphné Hervé (API, monitoring and QA automation lover)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postman</category>
      <category>api</category>
      <category>cheatsheet</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
