<?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 Prem Singh Rathore on Medium]]></title>
        <description><![CDATA[Stories by Prem Singh Rathore on Medium]]></description>
        <link>https://medium.com/@prathore28647?source=rss-8f186f511ac5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*soD6Z60BGEsTtOmvx0TDpw.jpeg</url>
            <title>Stories by Prem Singh Rathore on Medium</title>
            <link>https://medium.com/@prathore28647?source=rss-8f186f511ac5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:54:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prathore28647/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[Speed & Scalability: Playwright MCP VS Selenium]]></title>
            <link>https://medium.com/@prathore28647/speed-scalability-playwright-mcp-vs-selenium-real-test-timings-546a96a681be?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/546a96a681be</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[playwright-automation]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 18:12:17 GMT</pubDate>
            <atom:updated>2026-01-04T12:15:18.728Z</atom:updated>
            <content:encoded><![CDATA[<p>This article explores the possibility of executing a simple test in Claude using Playwright MCP (a Model Context Protocol server that provides browser automation capabilities using Playwright) and Selenium WebDriver version 4.35.0.</p><figure><img alt="MCP Architecture" src="https://cdn-images-1.medium.com/max/1024/0*x8U2_np5ySBsSVqq.png" /><figcaption><a href="https://kalilinuxtutorials.com/wp-content/uploads/2025/10/MCP-Architecture.png">https://kalilinuxtutorials.com/wp-content/uploads/2025/10/MCP-Architecture.png</a></figcaption></figure><h3>What do we need?</h3><h4>Claude Desktop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhsU2WBROpoWCZOvvXa9oQ.png" /></figure><p>You need to install the <a href="https://claude.ai/download">Claude desktop app</a> and extend its capabilities with a Playwright MCP server, which will provide secure, controlled access to local resources and tools. This basically enables you to execute any test in the Claude IDE using plain English test steps.</p><h4>Selenium Webdriver</h4><pre>&lt;PackageReference Include=&quot;Selenium.WebDriver&quot; Version=&quot;4.35.0&quot; /&gt;</pre><p>This is the core component that has superseded the older, deprecated Selenium Remote Control (RC). It uses a set of APIs that directly control browser actions using a standardized protocol (W3C WebDriver).</p><h4>Key Features of My Automation Framework</h4><p><strong>Test Framework</strong>: Built on .NET 8 with C# 12.0</p><p><strong>Testing Tools</strong>:</p><ul><li>NUnit 3.14.0 for test framework</li><li>Selenium WebDriver 4.35.0 for web automation</li><li>Chrome WebDriver for browser automation</li></ul><p>You can choose your own automation environment based on your preferred programming language. Selenium supports multiple languages: Java, Python, C#, JavaScript, Ruby, PHP, and Perl.</p><h3>Test Setup</h3><p>This is the simple test case we will run through both Claude Playwright MCP and Selenium WebDriver.</p><blockquote>TC — Check that Search Results are Grouped by Content Type<br>Steps:<br>1. Go to the search page: [Internal website]<br>2. Perform search using term “heart”<br>3. Look for a “Documents” section on the page<br>4. Look for a “Videos” section on the page<br>5. Check that both section headers are clearly visible and readable</blockquote><blockquote>Expected Result:<br>- Search results should be organized into separate sections for Documents and Videos<br>- Both section headers should be clearly displayed</blockquote><h3>Hook Playwright MCP Server to Claude</h3><h4>Steps:</h4><p>Open Claude Desktop App</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0rNfidpLtyKSFE4zu-RGdw.png" /></figure><p>Click on the profile icon and go to settings or press Ctrl+,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3kNddwfkQ88WRnaB2ZZgw.png" /></figure><p>Go to developer tab and click on “Edit Config”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sKTyDSBYqVV1R3nOjM6oQ.png" /></figure><p>This will open a new folder and highlight a file called “claude_desktop_config.json”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23K6KsQwQxx1XTAqbdSlpw.png" /><figcaption>Claude Folder</figcaption></figure><p>Right-click and use “Edit with Notepad++”</p><p>Paste the standard config that works in most of the tools</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;playwright&quot;: {<br>      &quot;command&quot;: &quot;npx&quot;,<br>      &quot;args&quot;: [<br>        &quot;@playwright/mcp@latest&quot;<br>      ]<br>    }<br>  }<br>}</pre><p>Now restart Claude and check tools section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*bv55Esawl_HxYvj0Qa3vhQ.png" /><figcaption>Claude Search/Tools Section</figcaption></figure><h4>Automating the same steps in Selenium</h4><pre>        public void VerifySearchResultsAreGroupedByContentType()<br>        {<br>            // Step 1: Go to the search page with pain search term<br>            loginPage.NavigateToLoginPage();<br>            loginPage.LoginWithAccountManagerCredentials(); // Uses secure credentials from config<br><br>            // Wait for page to load<br>            wait.Until(driver =&gt; driver.Title.Length &gt; 0);<br><br>            // Step 1.1: Perform search with &quot;heart&quot; term<br>            var searchBox = wait.Until(driver =&gt; driver.FindElement(By.Id(&quot;searchTextBox&quot;)));<br>            searchBox.Clear();<br>            searchBox.SendKeys(&quot;heart&quot;);<br><br>            var searchButton = driver.FindElement(By.Id(&quot;searchSubmit&quot;));<br>            searchButton.Click();<br><br>            // Wait for search results to load<br>            wait.Until(driver =&gt; driver.Url.Contains(&quot;search&quot;) || driver.PageSource.Contains(&quot;search results&quot;));<br><br>            // Step 2: Look for a &quot;Documents&quot; section on the page<br>            var documentsSection = driver.FindElements(By.XPath(&quot;//div[@id=&#39;Documents&#39;]/table/thead/tr/th/span&quot;));<br>            Assert.IsTrue(documentsSection.Count &gt; 0, &quot;Documents section should be present on the search results page&quot;);<br><br>            // Verify Documents section header is visible and readable<br>            var documentsHeader = documentsSection.FirstOrDefault(element =&gt; element.Displayed);<br>            Assert.IsNotNull(documentsHeader, &quot;Documents section header should be visible&quot;);<br>            Assert.IsTrue(!string.IsNullOrEmpty(documentsHeader.Text), &quot;Documents section header should have readable text&quot;);<br><br>            // Step 3: Look for a &quot;Videos&quot; section on the page<br>            var videosSection = driver.FindElements(By.XPath(&quot;//div[@id=&#39;Videos&#39;]/table/thead/tr/th/span&quot;));<br>            Assert.IsTrue(videosSection.Count &gt; 0, &quot;Videos section should be present on the search results page&quot;);<br><br>            // Verify Videos section header is visible and readable<br>            var videosHeader = videosSection.FirstOrDefault(element =&gt; element.Displayed);<br>            Assert.IsNotNull(videosHeader, &quot;Videos section header should be visible&quot;);<br>            Assert.IsTrue(!string.IsNullOrEmpty(videosHeader.Text), &quot;Videos section header should have readable text&quot;);<br><br>            // Step 4: Check that both section headers are clearly visible and readable<br>            Console.WriteLine($&quot;Documents section text: {documentsHeader.Text}&quot;);<br>            Console.WriteLine($&quot;Videos section text: {videosHeader.Text}&quot;);<br><br>            // Additional verification that sections are properly organized<br>            Assert.IsTrue(documentsHeader.Text.Contains(&quot;Documents&quot;), <br>                &quot;Documents section should contain &#39;Documents&#39; text&quot;);<br>            Assert.IsTrue(videosHeader.Text.Contains(&quot;Videos&quot;), <br>                &quot;Videos section should contain &#39;Videos&#39; text&quot;);<br>        }</pre><p>If you have Selenium WebDriver set up and running locally, you can simply copy and paste the above code snippet and execute it via the Test Explorer or Command Prompt (CMD).</p><h3>Test Execution Time</h3><h4>Playwright MCP + Claude</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*0w7zhegxHxaFHHVYmu9Kvg.gif" /><figcaption>Test Execution in Claude using Playwright MCP Server</figcaption></figure><h4>Test Result: PASSED ✅</h4><h4>TC1.1 — Check that Search Results are Grouped by Content Type</h4><p><strong>Test Execution Summary:</strong></p><ol><li>✅ Successfully navigated to <a href="https://dev01.kramesondemand.com/Login.aspx">https://dev01.kramesondemand.com/Login.aspx</a></li><li>✅ Successfully logged in with provided credentials (Account: TestAccount1, User: accountmgr)</li><li>✅ Performed search using the term “heart”</li><li>✅ Search returned 367 total results</li></ol><p><strong>Expected Result Verification:</strong></p><p>✅ <strong>Documents Section Found</strong>:</p><ul><li>Section header clearly visible: “<strong>Documents | 10 of 204 results</strong>”</li><li>Shows 10 documents per page out of 204 total document results</li><li>Includes various document types (Custom documents, editable documents)</li></ul><p>✅ <strong>Videos Section Found</strong>:</p><ul><li>Section header clearly visible: “<strong>Videos | 10 of 118 results</strong>”</li><li>Shows 10 videos per page out of 118 total video results</li><li>Includes various video topics related to heart health</li></ul><p><strong>Additional Observations:</strong></p><ul><li>Both section headers are prominently displayed in red text</li><li>Each section has its own pagination controls (showing “1–10 of X” and Previous/Next buttons)</li><li>Each section includes a “See All” link (+ See All Documents, + See All Videos)</li><li>Results are properly organized with checkboxes, titles, and language indicators</li><li>The total results summary at the top shows “Results Returned: 367 total results for search term ‘heart’”</li></ul><p>The search functionality is working correctly and results are properly grouped by content type as expected.</p><p><strong>Test execution time: </strong>3 m 54 s = 234 s</p><h4>Selenium + C#</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N3JlIjFrjNOHTXXjzxmPlw.gif" /></figure><p>A total of 1 test files matched the specified pattern.</p><p>Documents section text: Documents</p><p>Videos section text: Videos</p><p>TestRailCaseId property could not be parsed to int: TKOD-1021</p><p>Passed! — Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 22 s — PasswordResetFlow.dll (net8.0)</p><p><strong>Test execution time: </strong>39 s</p><p>As the test executions clearly demonstrate, <strong><em>Selenium is 83.76% faster than Playwright MCP + Claude</em></strong>, which makes Selenium still unbeatable. Although I see a lot of promise in MCP server, there is still room for improvement, and I’m excited to see how it will unfold.</p><blockquote>Here’s a trivia for you to try yourself</blockquote><p>We can run automated tests in Selenium in headless mode using a specific configuration.</p><pre>options.AddArgument(&quot;--headless&quot;);</pre><p>Can Claude + Playwright MCP server run tests in headless mode?</p><h3>Open-source test setup for you to try yourself</h3><h4>Command for Claude Desktop App</h4><ol><li>Go to <a href="https://www.saucedemo.com/">https://www.saucedemo.com/</a> and login as a standard user</li><li>Add the Sauce Labs Fleece Jacket to the cart and proceed with checkout using random user details.</li><li>Click on the cart icon to view the cart and proceed to checkout</li><li>Now click the “Checkout” button to proceed.</li><li>Fill in random user details for the first name, last name, and zip code.</li><li>Now click the “Continue” button to proceed to the next step</li><li>Now click the “Finish” button to complete the checkout</li><li>The order confirmation page should show:</li></ol><ul><li><strong>“Checkout: Complete!”</strong></li><li><strong>“Thank you for your order!”</strong></li><li>“Your order has been dispatched, and will arrive just as fast as the pony can get there!”</li></ul><h4>Selenium C# Script</h4><pre>using NUnit.Framework;<br>using OpenQA.Selenium;<br>using OpenQA.Selenium.Chrome;<br>using System;<br><br>namespace SeleniumPractise<br>{<br>    public class SeleniumFirst<br>    {<br>        WebDriver driver;<br>        [SetUp]<br>        public void Setup()<br>        {<br>            new WebDriverManager.DriverConfigs.Impl.ChromeConfig();<br><br>            ChromeOptions options = new ChromeOptions();<br>            options.AddUserProfilePreference(&quot;credentials_enable_service&quot;, false);<br>            options.AddUserProfilePreference(&quot;profile.password_manager_enabled&quot;, false);<br><br>            driver = new ChromeDriver();<br>            driver.Manage().Window.Maximize();<br>            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);<br>        }<br><br>        [Test]<br>        public void Test1()<br>        {<br>            // Navigate to SauceDemo<br>            driver.Navigate().GoToUrl(&quot;https://www.saucedemo.com/&quot;);<br><br>            // Login as standard_user<br>            driver.FindElement(By.Id(&quot;user-name&quot;)).SendKeys(&quot;standard_user&quot;);<br>            driver.FindElement(By.Id(&quot;password&quot;)).SendKeys(&quot;secret_sauce&quot;);<br>            driver.FindElement(By.Id(&quot;login-button&quot;)).Click();<br>            TestContext.WriteLine(&quot;Logged in as a standard user (standard_user)&quot;);<br><br>            // Add Sauce Labs Fleece Jacket to cart<br>            driver.FindElement(By.Id(&quot;add-to-cart-sauce-labs-fleece-jacket&quot;)).Click();<br>            TestContext.WriteLine(&quot;Added the Sauce Labs Fleece Jacket ($49.99) to the cart&quot;);<br><br>            // Go to cart<br>            driver.FindElement(By.ClassName(&quot;shopping_cart_link&quot;)).Click();<br><br>            // Proceed to checkout<br>            driver.FindElement(By.Id(&quot;checkout&quot;)).Click();<br>            TestContext.WriteLine(&quot;Proceeded to checkout&quot;);<br><br>            // Fill in user details<br>            driver.FindElement(By.Id(&quot;first-name&quot;)).SendKeys(&quot;John&quot;);<br>            driver.FindElement(By.Id(&quot;last-name&quot;)).SendKeys(&quot;Smith&quot;);<br>            driver.FindElement(By.Id(&quot;postal-code&quot;)).SendKeys(&quot;12345&quot;);<br>            driver.FindElement(By.Id(&quot;continue&quot;)).Click();<br>            TestContext.WriteLine(&quot;Filled in random user details (John Smith, ZIP: 12345)&quot;);<br><br>            // Verify order details<br>            string itemTotal = driver.FindElement(By.ClassName(&quot;summary_subtotal_label&quot;)).Text;<br>            string tax = driver.FindElement(By.ClassName(&quot;summary_tax_label&quot;)).Text;<br>            string total = driver.FindElement(By.ClassName(&quot;summary_total_label&quot;)).Text;<br><br>            Assert.That(itemTotal.Contains(&quot;49.99&quot;), &quot;Item total should be $49.99&quot;);<br>            Assert.That(tax.Contains(&quot;4.00&quot;), &quot;Tax should be $4.00&quot;);<br>            Assert.That(total.Contains(&quot;53.99&quot;), &quot;Total should be $53.99&quot;);<br>            TestContext.WriteLine(&quot;Reviewed the order (Total: $53.99 including $4.00 tax)&quot;);<br><br>            // Complete purchase<br>            driver.FindElement(By.Id(&quot;finish&quot;)).Click();<br>            TestContext.WriteLine(&quot;Completed the purchase&quot;);<br><br>            // Verify order completion<br>            IWebElement confirmationMessage = driver.FindElement(By.ClassName(&quot;complete-header&quot;));<br>            Assert.That(confirmationMessage.Text, Is.EqualTo(&quot;Thank you for your order!&quot;));<br>        }<br><br>        [TearDown]<br>        public void TearDown()<br>        {<br>            driver.Quit();<br>        }<br>    }<br>}</pre><p><strong>Checkout the video</strong>: <a href="https://youtu.be/C0aDaf_MsD0?si=NaAWaGWlz6bDrnFK"><strong><em>Playwright MCP Server — Is This The End of Selenium?</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=546a96a681be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Keep Your App Idea From Being Stolen?]]></title>
            <link>https://medium.com/@prathore28647/how-to-keep-your-app-idea-from-being-stolen-62ef6b8e68e4?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/62ef6b8e68e4</guid>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[ideas]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Sun, 21 Aug 2022 16:14:49 GMT</pubDate>
            <atom:updated>2022-08-21T16:14:49.995Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gZE6WiL8BMBhsnA4" /><figcaption>Photo by <a href="https://unsplash.com/@rishabhdharmani?utm_source=medium&amp;utm_medium=referral">Rishabh Dharmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It has been quite a while since the development of the first mobile app. Yet, the prospect of trying out new apps still excites users, especially once they try them out on new mobile devices or wearables.</p><p>It results in leading app stores teeming with billions of apps and an overwhelming number of downloads per year.</p><p>The mobile app development industry is booming and holds a lot of potential. Many mobile app development companies and startups want to tap into this potential.</p><p>So, if you’re someone with an app idea and want to try it out in the market, at the same time, keep it from being stolen.</p><p>Below are a few steps to prevent that idea from being stolen.</p><h3>Copywrite The App</h3><p>The best way to earn the legal rights for your app is to get the copyright together.</p><p>Copyright is one of the very well-known terms as far as protecting intellectual properties is concerned.</p><p>However, in this case, it comes with a huge drawback. You can’t copyright an idea.</p><p>Yes, you can get the UI and the code elements copyrighted. But, this is only ideal if someone tries to copy the entire app with no variation.</p><p>The main advantage of copyrighting an app is that it costs relatively less than other options and provides protection against the direct copier.</p><h3>Non-Disclosure Agreement</h3><p>Possibly, the most common step taken by various business establishments to protect their intellectual property is to get a Non-Disclosure Agreement.</p><blockquote>Whether you are hiring an app developer, designer, or even business development executive, ask them to sign an NDA with you for your app project.</blockquote><p>After signing the NDA, you can explain your idea to the developer freely because now the information cannot get shared with the third person.</p><p>You need the best attorney to prepare the NDA, which serves the purpose.</p><h3>Reserve the App Name</h3><p>In an Android store, you can have multiple apps with the same name, but not with the IOS store. You should reserve your app name in advance.</p><p><strong>Here are the steps to reserve the app name:</strong></p><ol><li>Open your appstoreconnect.apple.com account.</li><li>Click on the “My Apps” section in the top right corner.</li><li>Go to “Add New App.”</li><li>Upload the app bundle.</li><li>Press “Create,” and your app name is now reserved.</li><li>Once your app is ready, you can upload the app from Xcode.</li></ol><p>After completing these steps, the rest of the process should be straightforward, and any copycats will have to figure out a different concept for their app.</p><h3>Trademark the App</h3><p>Trademarks prevent others from using words and symbols such as icons and logos associated with your app or service.</p><p>Apart from the logo and icon of your app, you may also want to trademark the services and features your app provides.</p><p>Even if someone tries to copy your work, there’s going to be a trademark registered with your brand name.</p><p>The best thing about trademarks is that they do not let your competitors from creating copies of your products with similar features and functionalities to trick potential customers into purchasing their products instead of yours.</p><p>In addition to restricting the development of similar software. Trademarking also provides a unique way for you to connect with your users and build brand awareness.</p><h3>Document Everything</h3><p>Writing down everything about your app can be beneficial for you.</p><p>Save all the documentation related to it, however small it may be.</p><p>It will give you an upper when proving your stance in a court of law.</p><p>Document the app’s code, the brainstorming session, and minutes of the meeting conducted virtually or in person with your consultants, blueprint the final draft, etc.</p><p>For example, keep a log of every conversation you had with anyone related to the app, be it via message or an email thread.</p><p>It will be helpful as and when you find out that the information from these conversations has leaked, and you will have substantial proof to support your standpoint.</p><h3>Final Thoughts</h3><p>Don’t lose sleep over the thought that your mobile app’s idea can easily be stolen by your rivals. Follow the steps, and you’ll be good to go.</p><p>Even if your mobile app is so good that it outsmarts most of your competitors, it’s always a good idea to release the basic version of your app and save the best features and functionality for later.</p><p>You can also offer unique updates from time to time that includes these functionalities and features.</p><p>Happy App Building!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62ef6b8e68e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top social networking sites for Developers in 2022.]]></title>
            <link>https://medium.com/@prathore28647/are-you-a-developer-here-are-the-top-social-networking-sites-for-you-22bffb79cc14?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/22bffb79cc14</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[social-media]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Sun, 03 Jul 2022 07:05:11 GMT</pubDate>
            <atom:updated>2022-07-09T02:34:53.372Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will discuss some top social networking sites in 2022 that can help your web development journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rzsiA5szKI-_GKwF" /><figcaption>Photo by <a href="https://unsplash.com/@cookiethepom?utm_source=medium&amp;utm_medium=referral">Cookie the Pom</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>In the world of social media, where we are getting more connected, one should learn to harness the power of community.</blockquote><h4>Medium</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jw7pf0e6hRO8nj3M" /><figcaption>Photo by <a href="https://unsplash.com/@retrosupply?utm_source=medium&amp;utm_medium=referral">RetroSupply</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Evan William created this website in August 2012. He coined the term blogger, which later became trendy as a blog. The idea behind Medium was to give people more word length to express themselves than its previous company Twitter provided, which was about 140 characters.</p><p>In 2016 7.5 million articles were published on the medium, and over 60 million readers used the platform.</p><p>You can write articles or posts on Medium and can get paid for it based on the total article read time.</p><p>So, you can read about anything, and there are tons of articles you can find related to website development on Medium, which you can read, like, and share with your friends also.</p><h4>Hackernoon</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HC7KvQrICRVC1MBC" /><figcaption>Photo by <a href="https://unsplash.com/@hackernoon?utm_source=medium&amp;utm_medium=referral">Hacker Noon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hackernoon began its journey in January 2016 as a Hacker Daily on Medium and finally became Hackernoon in April 2016.</p><p>The site is run by the husband and wife duo of David and Linh Dao Smooke and gained popularity in October 2016 with articles such as <a href="https://hackernoon.com/why-everyone-missed-the-most-mind-blowing-feature-of-cryptocurrency-860c3f25f1fb"><em>Why Everyone Missed the Most Mind-Blowing Feature of Cryptocurrency</em>.</a> I m harvesting credit card numbers and passwords from your site. <a href="https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f">Here’s how. How does it feel about learning Javascript in 2016,</a> <a href="https://hackernoon.com/the-ethereum-blockchain-size-has-exceeded-1tb-and-yes-its-an-issue-2b650b5f4f62">The Ethereum blockchain size has exceeded 1TB, and yes, it’s an issue.</a></p><p>Here people write about the latest trends in the technological planet on topics like Metaverse, Crypto, Blockchain, or Web Development.</p><p>You can read some of the highest quality content available on the Internet through Hackernoon, which is also ad-free.</p><h4>HashNode</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hK1-p6aDcfHAgSTF" /><figcaption>Logo by <a href="https://geeky-chakri.hashnode.dev/">Geeki Chakri</a></figcaption></figure><p>The founders of HashNode were Fazel Rahman and Sandeep Panda(Co-Founder and CTO), which began in 2020.</p><p>The purpose of Hashnode was to make a global community of developers where you can connect with other developers, share knowledge, and help grow the community.</p><p>Here people write about their learning and experiences while working on cool projects.</p><p>You can also import articles from Medium and publish them on the Hash node.</p><h4>Code Project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*ww8pWqBt7UJH-Uqk.png" /><figcaption>Image by <a href="https://www.iconfinder.com/">ICONFINDER</a></figcaption></figure><p>Chris Maunder and David Cunningham created Code Project.</p><p>Code Project provides developers with an open platform where they can freely share their knowledge, ideas, and codes.</p><p>It contains various article topics, such as content highlighting tips and tricks for beginners in technical blogs. To help the community grow, developers and programmers can write their articles and submit their work to Code Project.</p><p>Members can take help from Code Project quick answer section. This section provides questions and answers for topics such as C#, HTML, CSS, C++, ASP.NET, and C#4.0.</p><h4>Dev Community</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A4O3T80ZKTR1zSWF" /><figcaption>Image by <a href="https://www.linkedin.com/showcase/dev-a-forem-community/">Dev community</a></figcaption></figure><p>Dev community provides a platform for the software developers to come together and help each other.</p><p>DEV has built on Forem: open-source software designed to empower communities. Because our application is open source, you can inspect every little detail of the code or chip in yourself! Forem is available for anyone interested in creating similar communities in any niche or passion. Visit our meta Forem, forem.dev for more information.</p><p>DEV has led by Forem’s co-founders, Ben Halpern, Jess Lee, and Peter Frank (“PB&amp;J”).</p><p>You’ll find a lot of technical content related to web development and other topics, which you can browse through.</p><h4>In the end, it is all about learning and sharing what you&#39;ve learned with the community because, as Muhammad Tahir-ul-Qadri quotes, “If knowledge is not put into practice, it does not benefit thou.</h4><h4>References:</h4><ul><li><a href="https://medium.com/">Medium: Read and write stories.</a></li><li><a href="https://dev.to/">DEV Community</a></li><li><a href="https://hackernoon.com/">HackerNoon - read, write and learn about any technology</a></li><li><a href="https://hashnode.com/">Hashnode - Build blogs and API docs for developers and teams.</a></li><li><a href="https://www.codeproject.com/">CodeProject</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22bffb79cc14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Metaverse and Its Applications]]></title>
            <link>https://medium.com/thecapital/metaverse-and-its-applications-3e74c4d367ae?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e74c4d367ae</guid>
            <category><![CDATA[metaverse]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Sat, 25 Jun 2022 14:58:57 GMT</pubDate>
            <atom:updated>2022-06-27T09:30:58.698Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will discuss Metaverse and how it is getting implemented in the real world.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ClZHL0SGL_oey1se" /><figcaption>Photo by <a href="https://unsplash.com/@jezar?utm_source=medium&amp;utm_medium=referral">Jezael Melgoza</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>What is Metaverse?</strong></h3><blockquote>In simple words, the Metaverse is another world that is far from the real world, yet all the real-world scenarios can be done in the Metaverse such as attending conferences, doing social outings, or even talking to a friend who’s miles away from you.</blockquote><h4>Origin of Metaverse</h4><p>The term <em>metaverse</em> was coined in Neal Stephenson’s 1992 science fiction novel <em>Snow Crash</em>, where humans, as programmable avatars, interact with each other and software agents, in a three-dimensional virtual space that uses the metaphor of the real world. Stephenson used the term to describe a virtual reality-based successor to the internet.</p><h4>Avatars in Metaverse</h4><p>I know all of these sound very magical and fairytale-like, but it can be done using Avatars. An Avatar is like your profile picture on Facebook that’s how people recognize you. You can create your avatar as per your preference on appearance, just like you do while playing video games.</p><p>Now, you can also tweak the avatar look whenever you like while participating in different activities. You can wear a professional outfit for your conference meetings, you can wear some funky-looking outfits as well if you are going out for socializing.</p><h4>Capitalism in Metaverse</h4><p>Metaverse is not only limited to daily events that I mentioned above. In Metaverse, you can buy a car, land, or clothes, pretty much anything that you can buy in the real world, and similarly, you can also sell things in the metaverse. The only difference is that you can’t use real-world currency, for making these transactions, you have to use <a href="https://en.wikipedia.org/wiki/Non-fungible_token">NFTs</a> (Non-Fungible Tokens).</p><h3>Metaverse In Learning Spaces</h3><p>After the COVID-19 pandemic, more and more people have shifted toward digital modes of communication. Video conferencing platforms have also become much more popular for remote work, online classes, and other work-from-home arrangements. These platforms fail to provide a compelling, engaging experience because of real-time audio and video interaction.</p><p>Metaverse provides users with a more engaging experience to address this limitation through its graphically rich virtual environment, 3-D avatars, and immersive meetings. Instead of seeing the participants on a computer screen and communicating through microphones, the Metaverse allows us to navigate a virtual environment with lifelike participants’ avatars.</p><p>Similarly, it has an impact in other fields as well, such as eCommerce businesses and on social media platforms.</p><blockquote>Done well, the metaverse could be a positive force for inclusion and equity, bridging some of the divides that exist in today’s physical and digital spaces. — <a href="https://nickclegg.medium.com/">Nick Clegg</a></blockquote><p><strong>Check out our new platform </strong>👉<strong> </strong><a href="https://thecapital.io/"><strong>https://thecapital.io/</strong></a></p><p><a href="https://twitter.com/thecapital_io">https://twitter.com/thecapital_io</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Ff%2F3c1144%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2F3c1144&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b6b127891c5c8711ad105e61d6cc81f/href">https://medium.com/media/3b6b127891c5c8711ad105e61d6cc81f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e74c4d367ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thecapital/metaverse-and-its-applications-3e74c4d367ae">Metaverse and Its Applications</a> was originally published in <a href="https://medium.com/thecapital">The Capital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Generate Access Token For Magento Admin via Postman]]></title>
            <link>https://medium.com/@prathore28647/how-to-generate-access-token-for-magento-admin-via-postman-d97099d63493?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d97099d63493</guid>
            <category><![CDATA[magento]]></category>
            <category><![CDATA[access-token]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 12:56:15 GMT</pubDate>
            <atom:updated>2021-09-17T12:56:15.604Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will get the admin access token using the <a href="https://medium.com/u/e89794fc6567">Magento</a> APIs and will create a customer account.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lqr-aoOD564bq7PG" /><figcaption>Photo by <a href="https://unsplash.com/@zisun_word?utm_source=medium&amp;utm_medium=referral">ZSun Fu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>👇 Check out my article on product creation in Magento if you haven’t 👇</p><p><a href="https://medium.com/@prathore28647/creating-products-using-magento-api-733a960463b5">Creating Products using Magento API</a></p><p>Magento is an eCommerce platform built on open source technology that provides <strong>online merchants with a flexible shopping cart system</strong>, as well as control over the look, content, and functionality of their online store. Magento offers powerful marketing, search engine optimization, and catalog-management tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*V5Q9VCs37DZ0iB_j.jpg" /><figcaption>Meme source: Google</figcaption></figure><p>To generate the access token we will use the below URI.</p><pre>{{Website URL}}/rest/V1/integration/admin/token</pre><p>We need to set the content type to JSON format in the header section.</p><pre>Content-Type : application/json</pre><p>And, The payload which we will send along with the request.</p><pre>{</pre><pre>&quot;username&quot;: &quot;ktplqa&quot;,</pre><pre>&quot;password&quot;: &quot;krishqa1&quot;</pre><pre>}</pre><h4>Note: Make sure the username and password are for a valid admin.</h4><p>Hit the request in the Postman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ylfar-l2zn8bicnhgSbTiQ.png" /><figcaption>POST Request in Postman</figcaption></figure><p>And, In the response, you will get the access token.</p><pre>&quot;89z9pnlxl0oqnky50d5p54o0jit45mcr&quot;</pre><h3>Creating new customers in the backend 🤵🏼</h3><p>We will use the <strong><em>generated access token</em></strong> to create a customer in the backend.</p><p>The URI we are gonna be using is</p><pre>{{Website URL}}/rest/V1/customers</pre><p>Again, set the content type to JSON format in the header section.</p><pre>Content-Type : application/json</pre><p>Finally, here is the payload we will need to send with the request.</p><pre>{</pre><pre>&quot;customer&quot;: {</pre><pre>&quot;email&quot;: &quot;johnd@blackmail.com&quot;,</pre><pre>&quot;firstname&quot;: &quot;John&quot;,</pre><pre>&quot;lastname&quot;: &quot;Doe&quot;,</pre><pre>&quot;custom_attributes&quot;: [</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;usermobile&quot;,</pre><pre>&quot;value&quot;: &quot;5884367081&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;tamayaz_point&quot;,</pre><pre>&quot;value&quot;: &quot;300&quot;</pre><pre>}</pre><pre>]</pre><pre>},</pre><pre>&quot;password&quot;: &quot;john@$321&quot;</pre><pre>}</pre><h4>Note: Both the request we will be POST in nature.</h4><p>Below is the response you will get in the Postman.</p><pre>{</pre><pre>&quot;id&quot;: 46,</pre><pre>&quot;group_id&quot;: 4,</pre><pre>&quot;created_at&quot;: &quot;2021-09-17 12:40:45&quot;,</pre><pre>&quot;updated_at&quot;: &quot;2021-09-17 12:40:45&quot;,</pre><pre>&quot;created_in&quot;: &quot;English&quot;,</pre><pre>&quot;email&quot;: &quot;johnd@blackmail.com&quot;,</pre><pre>&quot;firstname&quot;: &quot;John&quot;,</pre><pre>&quot;lastname&quot;: &quot;Doe&quot;,</pre><pre>&quot;store_id&quot;: 1,</pre><pre>&quot;website_id&quot;: 1,</pre><pre>&quot;addresses&quot;: [],</pre><pre>&quot;disable_auto_group_change&quot;: 0,</pre><pre>&quot;extension_attributes&quot;: {</pre><pre>&quot;is_subscribed&quot;: <strong>false</strong></pre><pre>},</pre><pre>&quot;custom_attributes&quot;: [</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;usermobile&quot;,</pre><pre>&quot;value&quot;: &quot;5884367081&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;tamayaz_point&quot;,</pre><pre>&quot;value&quot;: &quot;300&quot;</pre><pre>}</pre><pre>]</pre><pre>}</pre><p>Let’s login into the website using the same email and password as in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C7mspaE2I3UeEMsLf0ItyQ.png" /><figcaption>My account section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/0*1qi0Ep3HtP3MXL6b" /><figcaption>Meme source: Google</figcaption></figure><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d97099d63493" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Products using Magento API]]></title>
            <link>https://medium.com/@prathore28647/creating-products-using-magento-api-733a960463b5?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/733a960463b5</guid>
            <category><![CDATA[post]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[magento]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[product]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Wed, 08 Sep 2021 13:08:14 GMT</pubDate>
            <atom:updated>2021-09-08T16:29:59.994Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will use the <a href="https://medium.com/u/e89794fc6567">Magento eCommerce</a> POST API to create a product with Postman.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*DLXmcNMDNIdbI_bh.jpeg" /><figcaption>Image source: Google</figcaption></figure><h3>What is Magento APIs❓</h3><p><em>Magento API is a framework that offers developers and integrators a good method to maximize web services that communicate well with the Magneto system.</em></p><p>The <strong><em>URI</em></strong> we are gonna need to create the product is.</p><pre>https://MagentoHost/rest/V1/products</pre><h4>Note: Your website URL will come in place of Magento Host.</h4><p>The payload body, which we will send along with the request.</p><pre>{</pre><pre>&quot;product&quot;: {</pre><pre>&quot;sku&quot;: &quot;256478945148&quot;,</pre><pre>&quot;name&quot;: &quot;Sample Product&quot;,</pre><pre>&quot;attribute_set_id&quot;: &quot;4&quot;,</pre><pre>&quot;price&quot;: &quot;250&quot;,</pre><pre>&quot;status&quot;: &quot;1&quot;,</pre><pre>&quot;visibility&quot;: &quot;4&quot;,</pre><pre>&quot;type_id&quot;: &quot;simple&quot;,</pre><pre>&quot;weight&quot;: &quot;1&quot;,</pre><pre>&quot;extension_attributes&quot;: {</pre><pre>&quot;category_links&quot;: [</pre><pre>{</pre><pre>&quot;position&quot;: &quot;0&quot;,</pre><pre>&quot;category_id&quot;: &quot;6&quot;</pre><pre>}</pre><pre>],</pre><pre>&quot;stock_item&quot;: {</pre><pre>&quot;qty&quot;: &quot;50&quot;,</pre><pre>&quot;is_in_stock&quot;: <strong>true</strong></pre><pre>}</pre><pre>},</pre><pre>&quot;custom_attributes&quot;: [</pre><pre>{</pre><pre>  &quot;attribute_code&quot;: &quot;express_delivery_product&quot;,</pre><pre>  &quot;value&quot;: &quot;1&quot;</pre><pre>},</pre><pre>{</pre><pre>  &quot;attribute_code&quot;: &quot;is_grocery_product&quot;,</pre><pre>  &quot;value&quot;: &quot;0&quot;</pre><pre>}</pre><pre>]</pre><pre>}</pre><pre>}</pre><h4>Note: The custom attributes are based on the product attributes defined in the backend.</h4><p>Also, we need to set the content type to JSON format in the header section.</p><pre>Content-Type : application/json</pre><p>Finally, the <strong><em>authorization key</em></strong>, which you need to get from the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*OrFcdfn-y_e43Shz.png" /><figcaption>Image source: Google</figcaption></figure><p>Select <strong><em>Bearer Token</em></strong> option under the <strong><em>Authorization Tab</em></strong> and provide the <strong><em>Access Token</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*UC7C7jwz1rpsAv6HvzFEOg.png" /><figcaption>Authorization Tab</figcaption></figure><p>Now, you hit the send button and wait for the <strong><em>response</em></strong>.</p><pre>{</pre><pre>&quot;id&quot;: 62,</pre><pre>&quot;sku&quot;: &quot;<strong>256478945148</strong>&quot;,</pre><pre>&quot;name&quot;: &quot;<strong>Sample Product</strong>&quot;,</pre><pre>&quot;attribute_set_id&quot;: 4,</pre><pre>&quot;price&quot;: 250,</pre><pre>&quot;status&quot;: 1,</pre><pre>&quot;visibility&quot;: 4,</pre><pre>&quot;type_id&quot;: &quot;simple&quot;,</pre><pre>&quot;created_at&quot;: &quot;2021-09-08 12:54:59&quot;,</pre><pre>&quot;updated_at&quot;: &quot;2021-09-08 12:54:59&quot;,</pre><pre>&quot;weight&quot;: 1,</pre><pre>&quot;extension_attributes&quot;: {</pre><pre>&quot;website_ids&quot;: [</pre><pre>1</pre><pre>],</pre><pre>&quot;category_links&quot;: [</pre><pre>{</pre><pre>&quot;position&quot;: 0,</pre><pre>&quot;category_id&quot;: &quot;6&quot;</pre><pre>}</pre><pre>],</pre><pre>&quot;stock_item&quot;: {</pre><pre>&quot;item_id&quot;: 232,</pre><pre>&quot;product_id&quot;: 62,</pre><pre>&quot;stock_id&quot;: 1,</pre><pre>&quot;qty&quot;: 50,</pre><pre>&quot;is_in_stock&quot;: <strong>true</strong>,</pre><pre>&quot;is_qty_decimal&quot;: <strong>false</strong>,</pre><pre>&quot;show_default_notification_message&quot;: <strong>false</strong>,</pre><pre>&quot;use_config_min_qty&quot;: <strong>true</strong>,</pre><pre>&quot;min_qty&quot;: 0,</pre><pre>&quot;use_config_min_sale_qty&quot;: 1,</pre><pre>&quot;min_sale_qty&quot;: 1,</pre><pre>&quot;use_config_max_sale_qty&quot;: <strong>true</strong>,</pre><pre>&quot;max_sale_qty&quot;: 10000,</pre><pre>&quot;use_config_backorders&quot;: <strong>true</strong>,</pre><pre>&quot;backorders&quot;: 0,</pre><pre>&quot;use_config_notify_stock_qty&quot;: <strong>true</strong>,</pre><pre>&quot;notify_stock_qty&quot;: 1,</pre><pre>&quot;use_config_qty_increments&quot;: <strong>true</strong>,</pre><pre>&quot;qty_increments&quot;: 0,</pre><pre>&quot;use_config_enable_qty_inc&quot;: <strong>true</strong>,</pre><pre>&quot;enable_qty_increments&quot;: <strong>false</strong>,</pre><pre>&quot;use_config_manage_stock&quot;: <strong>true</strong>,</pre><pre>&quot;manage_stock&quot;: <strong>true</strong>,</pre><pre>&quot;low_stock_date&quot;: <strong>null</strong>,</pre><pre>&quot;is_decimal_divided&quot;: <strong>false</strong>,</pre><pre>&quot;stock_status_changed_auto&quot;: 0</pre><pre>}</pre><pre>},</pre><pre>&quot;options&quot;: [],</pre><pre>&quot;media_gallery_entries&quot;: [],</pre><pre>&quot;custom_attributes&quot;: [</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;url_key&quot;,</pre><pre>&quot;value&quot;: &quot;sample-product&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;options_container&quot;,</pre><pre>&quot;value&quot;: &quot;container2&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;brands&quot;,</pre><pre>&quot;value&quot;: &quot;21&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;msrp_display_actual_price_type&quot;,</pre><pre>&quot;value&quot;: &quot;0&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;required_options&quot;,</pre><pre>&quot;value&quot;: &quot;0&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;has_options&quot;,</pre><pre>&quot;value&quot;: &quot;0&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;tax_class_id&quot;,</pre><pre>&quot;value&quot;: &quot;2&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;category_ids&quot;,</pre><pre>&quot;value&quot;: [</pre><pre>&quot;6&quot;</pre><pre>]</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;is_returnable&quot;,</pre><pre>&quot;value&quot;: &quot;2&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;stock_check&quot;,</pre><pre>&quot;value&quot;: &quot;3&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;express_delivery_product&quot;,</pre><pre>&quot;value&quot;: &quot;1&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;is_grocery_product&quot;,</pre><pre>&quot;value&quot;: &quot;0&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;amtoolkit_robots&quot;,</pre><pre>&quot;value&quot;: &quot;0&quot;</pre><pre>},</pre><pre>{</pre><pre>&quot;attribute_code&quot;: &quot;am_offer_item_condition&quot;,</pre><pre>&quot;value&quot;: &quot;1&quot;</pre><pre>}</pre><pre>]</pre><pre>}</pre><p>And, <a href="https://demo-m2.bird.eu/">Here</a> is the Magento demo server for you to play with.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=733a960463b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APIs and HTTP Client: Validate POST call Response]]></title>
            <link>https://medium.com/@prathore28647/apis-and-http-client-validate-post-call-response-f9b7f8692939?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9b7f8692939</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[http-client]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[testng]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Sat, 28 Aug 2021 14:03:38 GMT</pubDate>
            <atom:updated>2021-08-29T21:30:08.072Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this piece, we will be validating the response from the POST request.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AJ0lBbtqFvXY18fG" /></figure><p>The payload we have provided in the last section is:</p><pre>{“name”:”morpheus”,”job”:”leader”}</pre><p>👇 Check out the article to see how we prepared the payload 👇</p><p><a href="https://medium.com/@prathore28647/apis-and-http-client-post-call-7f68d5a66fd9">APIs and HTTP Client: POST Call</a></p><h3>Calling POST API to generate the response</h3><p>We need to convert the payload to string to pass it with the request.</p><pre>String usersJsonString = mapper.writeValueAsString(users);</pre><p>Let’s call the POST request using HTTP Client and store the response.</p><pre>closeableHttpResponse = restClient.post(URL, usersJsonString, headerMap);</pre><h3>The Validation Begins Now 🏁</h3><p>Let’s verify the response status code first.</p><pre>int statusCode = closeableHttpResponse.getStatusLine().getStatusCode();</pre><pre>Assert.assertEquals(statusCode, testBase.RESPONSE_STATUS_CODE_201);</pre><p>Before validation, we will fetch the <strong><em>response</em></strong>, convert it into String, and print it on the console.</p><pre>String responseString = EntityUtils.toString(closeableHttpResponse.getEntity(), &quot;UTF-8&quot;);</pre><pre>JSONObject responseJson = new JSONObject(responseString);</pre><pre>System.out.println(&quot;The response from API is--&gt;&quot;+responseJson);</pre><p>Let’s run the code and check if it is printing the response.</p><pre>[RemoteTestNG] detected TestNG version 7.3.0</pre><pre>{&quot;name&quot;:&quot;morpheus&quot;,&quot;job&quot;:&quot;leader&quot;}</pre><pre><strong>The response from API is--&gt;{&quot;createdAt&quot;:&quot;2021-08-28T12:59:13.270Z&quot;,&quot;name&quot;:&quot;morpheus&quot;,&quot;id&quot;:&quot;512&quot;,&quot;job&quot;:&quot;leader&quot;}</strong></pre><pre>PASSED: postAPITest</pre><pre>===============================================</pre><pre>Default test</pre><pre>Tests run: 1, Failures: 0, Skips: 0</pre><pre>===============================================</pre><pre>===============================================</pre><pre>Default suite</pre><pre>Total tests run: 1, Passes: 1, Failures: 0, Skips: 0</pre><pre>===============================================</pre><p>We will convert this <strong><em>response</em></strong> into <strong><em>Java Object</em></strong> using the <strong><em>Un-Marshalling</em></strong> concept to validate the attribute values in the <strong><em>Users class</em></strong>.</p><pre>Users usersResObj = mapper.readValue(responseString, Users.class);</pre><pre>System.out.println(usersResObj);</pre><p>We will validate the values of name and job from the response using TestNG assertions.</p><pre>Assert.assertTrue(users.getName().equals(usersResObj.getName()));</pre><pre>Assert.assertTrue(users.getJob().equals(usersResObj.getJob()));</pre><p>Let’s run the code and check in the console if the validation is successful.</p><pre>[RemoteTestNG] detected TestNG version 7.3.0</pre><pre>{&quot;name&quot;:&quot;morpheus&quot;,&quot;job&quot;:&quot;leader&quot;,&quot;id&quot;:null,&quot;createdAt&quot;:null}</pre><pre>The response from API is--&gt;{&quot;createdAt&quot;:&quot;2021-08-28T13:35:00.835Z&quot;,&quot;name&quot;:&quot;morpheus&quot;,&quot;id&quot;:&quot;644&quot;,&quot;job&quot;:&quot;leader&quot;}</pre><pre>data.Users@5b58ed3c</pre><pre>PASSED: postAPITest</pre><pre>===============================================</pre><pre>Default test</pre><pre>Tests run: 1, Failures: 0, Skips: 0</pre><pre>===============================================</pre><pre>===============================================</pre><pre>Default suite</pre><pre>Total tests run: 1, Passes: 1, Failures: 0, Skips: 0</pre><pre>===============================================</pre><p>Awesome!</p><p><a href="https://github.com/Premsing/APIsandHTTPClient">Here</a> is the Git repo for you to download the code.</p><p>Thanks for reading.</p><h4>Declaration: This article is based on one of the videos by <a href="https://medium.com/u/63406024ff34">Naveen AutomationLabs</a> and, the video link is below.</h4><p><a href="https://www.youtube.com/watch?v=kV8UKPh-HBM&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=7">https://www.youtube.com/watch?v=kV8UKPh-HBM&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=7</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9b7f8692939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APIs and HTTP Client: POST Call]]></title>
            <link>https://medium.com/@prathore28647/apis-and-http-client-post-call-7f68d5a66fd9?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f68d5a66fd9</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[http-client]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Fri, 27 Aug 2021 13:42:17 GMT</pubDate>
            <atom:updated>2021-08-29T21:29:25.290Z</atom:updated>
            <content:encoded><![CDATA[<h4>I this article, we will call the POST API request using the HTTP Client java library.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*LqSJtWjIAYxLHqZ7aFm-7w.png" /><figcaption>Image source: Google</figcaption></figure><p><a href="https://reqres.in/">Here</a> are the Rest APIs which we will be using for the POST call</p><p>👇 Make sure you check out the GET call using HTTP Client if you haven’t 👇</p><p><a href="https://medium.com/@prathore28647/apis-and-http-client-get-call-adfd75139e1f">APIs and HTTP Client: GET Call</a></p><p>The payload we will be sending along with the request:</p><pre>{<br>    &quot;name&quot;: &quot;morpheus&quot;,<br>    &quot;job&quot;: &quot;leader&quot;<br>}</pre><h3>Automating POST API request in the Rest Client class 📄</h3><p>Let’s open the Rest Client class to create the POST call method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*_TTNcdF0GjVvhlaELeUxrw.png" /><figcaption>Rest Client class</figcaption></figure><p>We need to pass the <strong><em>endpoint URL</em></strong>, <strong><em>JSON payload</em></strong>, and <strong><em>Headers</em></strong> in the form of an argument.</p><pre>public void post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) <br>{</pre><pre>}</pre><p>Now, similar to the GET call, we will initialize the HTTP Client in the method.</p><pre>public void post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) {</pre><pre><strong>CloseableHttpClient httpClient = HttpClients.createDefault();</strong></pre><pre>}</pre><p>Create an object for the <strong><em>HTTP POST</em></strong> class.</p><pre>public void post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) {</pre><pre>CloseableHttpClient httpClient = HttpClients.createDefault();</pre><pre><strong>HttpPost httpPost = new HttpPost(url);</strong></pre><pre>}</pre><p>Now, to pass the payload, we will use the <strong><em>set Entity</em></strong> method.</p><pre>public void post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) <strong>throws UnsupportedEncodingException</strong> {</pre><pre>CloseableHttpClient httpClient = HttpClients.createDefault();</pre><pre>HttpPost httpPost = new HttpPost(url);</pre><pre><strong>httpPost.setEntity(new StringEntity(entityString));</strong></pre><pre>}</pre><h4><strong><em>Note: Make sure to add throws declaration for the Entity method</em></strong></h4><p>We will now pass the headers like how we did in the <a href="https://medium.com/@prathore28647/apis-and-http-client-get-call-adfd75139e1f">GET call request</a></p><pre>public void post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) throws UnsupportedEncodingException {</pre><pre>CloseableHttpClient httpClient = HttpClients.createDefault();</pre><pre>HttpPost httpPost = new HttpPost(url);</pre><pre>httpPost.setEntity(new StringEntity(entityString));</pre><pre><strong>// headers<br>for (Map.Entry&lt;String, String&gt; entry : headerMap.entrySet()) {</strong></pre><pre><strong>httpPost.addHeader(entry.getKey(), entry.getValue());</strong></pre><pre><strong>}</strong></pre><pre>}</pre><p>Let’s hit the URL using the <strong><em>execute method </em></strong>and store the response in the <strong><em>Closeable HTTP Response</em></strong> object.</p><pre>public CloseableHttpResponse post(String url, String entityString, HashMap&lt;String, String&gt; headerMap) <strong>throws ClientProtocolException, IOException</strong> {</pre><pre>CloseableHttpClient httpClient = HttpClients.createDefault();</pre><pre>HttpPost httpPost = new HttpPost(url); // post request</pre><pre>httpPost.setEntity(new StringEntity(entityString)); // payload</pre><pre>// headers<br>for (Map.Entry&lt;String, String&gt; entry : headerMap.entrySet()) {</pre><pre>httpPost.addHeader(entry.getKey(), entry.getValue());</pre><pre>}</pre><pre><strong>CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost); // hit the url</strong></pre><pre><strong>return closeableHttpResponse;</strong></pre><pre>}</pre><h3>Creating the first Test case for POST call</h3><p>We will create one <strong><em>POST Test class</em></strong> under the <strong><em>Tests package 📦</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*EgNOaYeoP2vscuCaGDhCZw.png" /><figcaption>Post Test class</figcaption></figure><p>We will inherit the Test Base class using extends keyword to use all its functions.</p><pre>package Tests;</pre><pre><strong>import base.TestBase;</strong></pre><pre><strong>public class PostAPITest extends TestBase </strong>{</pre><pre>}</pre><p>We will define one Setup method to call the constructor of the Base class (TestBase.java) and to fetch the endpoint URL</p><pre>public class PostAPITest extends TestBase{</pre><pre>TestBase testBase;<br>String mainURL;<br>String apiURL;<br>String URL;<br>RestClient restClient;<br>CloseableHttpResponse closeableHttpResponse;</pre><pre><strong>@BeforeMethod<br>public void setUp() {</strong></pre><pre><strong>testBase = new TestBase();</strong></pre><pre><strong>mainURL = prop.getProperty(&quot;URL&quot;);</strong></pre><pre><strong>apiURL = prop.getProperty(&quot;serviceURL&quot;);</strong></pre><pre><strong>URL = mainURL + apiURL;</strong></pre><pre><strong>}</strong></pre><pre>}</pre><p>Let’s create the <strong><em>Test case</em></strong> and object of the <strong><em>Rest Client class </em></strong>to call the post method.</p><pre>@Test<br>public void postAPITest() <br>{<br> <strong>restClient = new RestClient();</strong><br>}</pre><p>We will pass the headers using the HashMap object.</p><pre>@Test<br>public void postAPITest() {</pre><pre>restClient = new RestClient();</pre><pre><strong>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</strong></pre><pre><strong>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</strong></pre><pre>}</pre><p>To prepare the payload, we need to create one <strong><em>Users class</em></strong> under the <strong><em>data package 📦</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*vwSvi5EsDgM8kO5XZFtNBw.png" /><figcaption>Users Class — Pojo</figcaption></figure><p>And, we will define the attributes based on the <strong><em>payload</em></strong> we need to send and the <strong><em>response</em></strong> we will get</p><pre>package data;</pre><pre>public class Users {</pre><pre>private String name;<br>private String job;<br>private String id;<br>private String createdAt;</pre><pre>public Users() {</pre><pre>}</pre><pre>public Users(String name, String job) {</pre><pre>this.name = name;</pre><pre>this.job = job;</pre><pre>}</pre><pre>public String getName() {</pre><pre>return name;</pre><pre>}</pre><pre>public void setName(String name) {</pre><pre>this.name = name;</pre><pre>}</pre><pre>public String getJob() {</pre><pre>return job;</pre><pre>}</pre><pre>public void setJob(String job) {</pre><pre>this.job = job;</pre><pre>}</pre><pre>public String getId() {</pre><pre>return id;</pre><pre>}</pre><pre>public void setId(String id) {</pre><pre>this.id = id;</pre><pre>}</pre><pre>public String getCreatedAt() {</pre><pre>return createdAt;</pre><pre>}</pre><pre>public void setCreatedAt(String createdAt) {</pre><pre>this.createdAt = createdAt;</pre><pre>}</pre><pre>}</pre><h4>Note: This is famously called POJO classes(Plain Old Java Object) for converting an object into JSON and vice versa</h4><p>We need to define one <strong><em>Jackson dependency</em></strong> in the <strong><em>pom.xml</em></strong> file to convert the <strong><em>java object class(Users.java)</em></strong> into the <strong><em>JSON payload</em></strong>, aka <strong><em>Marshalling</em></strong></p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;<br>    &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;<br>    &lt;version&gt;2.12.4&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Once you paste it inside the pom.xml file and if you don’t see the relevant jars under the Maven dependencies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*XS0AxYP_GdJRL89pXUUkxA.png" /><figcaption>Maven Dependencies</figcaption></figure><p>Make sure you go to the <strong><em>Project</em></strong> option and click on <strong><em>clean</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*Nt5PozOE_FCnltHyy1-pEA.png" /><figcaption>Top Menu Section</figcaption></figure><p>And, clean it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*FxqV3RcUpLJzjV4dIlsg4w.png" /><figcaption>Clean Project Window</figcaption></figure><h4>Note: After the cleaning is done, you will see all the relevant jars which you’ve defined in the pom.xml file under Maven Dependencies.</h4><p>Now, go back to the Test class and create one object of the Mapper class.</p><pre>@Test<br>public void postAPITest() {</pre><pre>restClient = new RestClient();</pre><pre>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</pre><pre>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</pre><pre>//Jackson API:<br><strong>ObjectMapper mapper = new ObjectMapper();</strong></pre><pre>}</pre><p>And, one object of the User class, pass the <strong><em>name and the job</em></strong> argument.</p><pre>@Test<br>public void postAPITest() {</pre><pre>restClient = new RestClient();</pre><pre>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</pre><pre>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</pre><pre>//Jackson API:<br>ObjectMapper mapper = new ObjectMapper();</pre><pre><strong>Users users = new Users(&quot;morpheus&quot;, &quot;leader&quot;);</strong></pre><pre>}</pre><h3>Implementing Marshalling concept</h3><p>We will convert the <strong><em>Users object</em></strong> to one <strong><em>JSON file</em></strong></p><pre>@Test</pre><pre>public void postAPITest() {</pre><pre>restClient = new RestClient();</pre><pre>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</pre><pre>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</pre><pre>//Jackson API:<br>ObjectMapper mapper = new ObjectMapper();</pre><pre>Users users = new Users();</pre><pre>//Obj to Json file:<br><strong>mapper.writeValue(new File(&quot;&quot;), users);</strong></pre><pre>}</pre><p>We will create one Java class to store the JSON output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*zPg3CZVKKuegwvUREP3qHw.png" /><figcaption>users.json file</figcaption></figure><p>Get the path of this file and provide it in the <strong><em>File class</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*j0EgovhSM_P_lU0GcnvbEA.png" /><figcaption>Properties of user.json file</figcaption></figure><p>Copy and paste the path inside the mapper object File</p><pre>@Test<br>public void postAPITest() <strong>throws JsonGenerationException, JsonMappingException, IOException</strong> {</pre><pre>restClient = new RestClient();</pre><pre>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</pre><pre>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</pre><pre>//Jackson API:<br>ObjectMapper mapper = new ObjectMapper();</pre><pre>Users users = new Users();</pre><pre><strong>//Obj to Json file:</strong></pre><pre><strong>mapper.writeValue(new File(&quot;C:\\Users\\prem.rathore\\eclipse-workspace\\HTTPClient\\src\\main\\java\\data\\users.json&quot;), users);</strong></pre><pre>}</pre><h4>Note: After the file path, you need to give the Users class object in place of value</h4><p>Let’s run the Test and see if the conversion is happening or not in the users.json file</p><pre>{&quot;name&quot;:&quot;morpheus&quot;,&quot;job&quot;:&quot;leader&quot;}</pre><p>Awesome!</p><p><a href="https://github.com/Premsing/APIsandHTTPClient">Here</a> is the Git repo for you to download the code.</p><p>Thanks for reading.</p><h4>Declaration: This article is based on one of the videos by <a href="https://medium.com/u/63406024ff34">Naveen AutomationLabs</a> and, the video link is below.</h4><p><a href="https://www.youtube.com/watch?v=kV8UKPh-HBM&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=7">https://www.youtube.com/watch?v=kV8UKPh-HBM&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=7</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f68d5a66fd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is JSON❓]]></title>
            <link>https://medium.com/@prathore28647/what-is-json-dc4fc3f1d9b8?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc4fc3f1d9b8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[collector]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 14:09:18 GMT</pubDate>
            <atom:updated>2021-08-29T21:27:31.271Z</atom:updated>
            <content:encoded><![CDATA[<h4>And why 99% of the companies use JSON for exchanging the data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aANqCVRPQ0Q14cIi.png" /><figcaption>Image source: Google</figcaption></figure><h3>Definition:</h3><blockquote>JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute-value pairs and arrays</blockquote><h3>What is the full form of JSON?</h3><ul><li>JavaScript Object Notation is a lightweight data-interchange format.</li><li>It is easy for humans to read and write.</li><li>It is easy for machines to parse and generate.</li><li>It is based on a subset of the JavaScript Programming Language.</li></ul><h3>What is the purpose?</h3><p>For data communication between Client to Server, we use JSON objects.</p><h3>What are Marshalling and Unmarshalling?</h3><p>It is the converting of Object(POJO) into JSON and vice versa.</p><h3>What is the difference between JSON object and JSON array?</h3><p>JSON object will be in the form of simple key and value pair.</p><blockquote>Ex. Employee name: “Tom”</blockquote><p>JSON array will be in the form of a list as shown in below Ex.</p><pre>Mobile<br>[<br> Samsung : “S1”<br> Apple : “iPhone 11”<br> Motorola : “e5 plus”<br>]</pre><h4>Declaration: All the information provided is based on my understanding of the concept.</h4><p>Thanks for reading.</p><h4>Declaration: This article is based on one of the videos by <a href="https://medium.com/u/63406024ff34">Naveen AutomationLabs</a> and, the video link is below.</h4><p><a href="https://www.youtube.com/watch?v=ugb39NmkTVU&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=6">https://www.youtube.com/watch?v=ugb39NmkTVU&amp;list=PLFGoYjJGfqp891lruz5fCRPWsDtEXJky&amp;index=6</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc4fc3f1d9b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APIs and HTTP Client: Get Call With Headers]]></title>
            <link>https://medium.com/@prathore28647/apis-and-http-client-get-call-with-headers-c150982eaa8f?source=rss-8f186f511ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c150982eaa8f</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[apache-httpclient]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Prem Singh Rathore]]></dc:creator>
            <pubDate>Mon, 23 Aug 2021 13:55:59 GMT</pubDate>
            <atom:updated>2021-08-29T21:22:36.722Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will see how to pass headers along with the Get API request.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*DSdlrPpB90PmRSco.png" /><figcaption>Image source: Google</figcaption></figure><p>Let’s open the Rest Client class in Eclipse</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*l0e1llmKeYGM-Qc0GiamvQ.png" /><figcaption>Rest client class</figcaption></figure><p>Copy the same Get method and paste below in the Rest Client</p><pre>public CloseableHttpResponse get(String url) throws ClientProtocolException, IOException {</pre><pre>CloseableHttpClient httpClient = HttpClients.createDefault();</pre><pre>HttpGet httpget = new HttpGet(url); // http get request</pre><pre>CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpget); // hit the url</pre><pre>return closeableHttpResponse;</pre><pre>}</pre><p>We need to provide one header map argument along with the URL</p><pre>HashMap&lt;String, String&gt; headerMap</pre><h4>Here we are using the concept of function overloading</h4><p>Now, we have to iterate one loop to store the headers before we hit the URL</p><pre>for (Map.Entry&lt;String, String&gt; entry : headerMap.entrySet()) {</pre><pre>httpget.addHeader(entry.getKey(), entry.getValue());</pre><pre>}</pre><p>Now, we will open the Get API Test class</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*QuE_be-Z1Yuet2cbK5s5Qw.png" /><figcaption>Get API Test class</figcaption></figure><p>We can copy the same test and provide the name <strong><em>Get API Test with Headers.</em></strong></p><pre>@Test</pre><pre>public void getTestWithHeaders() throws ClientProtocolException, IOException {</pre><pre>restClient = new RestClient();</pre><pre>closeableHttpResponse = restClient.get(URL);</pre><pre>// 1. Status Code:</pre><pre>int statusCode = closeableHttpResponse.getStatusLine().getStatusCode();</pre><pre>System.out.println(&quot;Status Code--&gt;&quot; + statusCode);</pre><pre>Assert.assertEquals(statusCode, RESPONSE_STATUS_CODE_200, &quot;Status code is not 200&quot;);</pre><pre>// 2. Json String:</pre><pre>String responseString = EntityUtils.toString(closeableHttpResponse.getEntity(), &quot;UTF-8&quot;);</pre><pre>JSONObject responseJson = new JSONObject(responseString);</pre><pre>System.out.println(&quot;Response Json from GET API--&gt;&quot; + responseJson);</pre><pre>// Single value validation:</pre><pre>String perPageValue = TestUtil.getValueByJPath(responseJson, &quot;per_page&quot;);</pre><pre>System.out.println(&quot;Per Page value is--&gt;&quot;+perPageValue);</pre><pre>Assert.assertEquals(Integer.parseInt(perPageValue), 6);</pre><pre>String totalPagesValue = TestUtil.getValueByJPath(responseJson, &quot;total_pages&quot;);</pre><pre>System.out.println(&quot;Total Pages value is--&gt;&quot;+totalPagesValue);</pre><pre>Assert.assertEquals(Integer.parseInt(totalPagesValue), 2);</pre><pre>// Json array validation</pre><pre>String firstName = TestUtil.getValueByJPath(responseJson, &quot;data[0]/first_name&quot;);</pre><pre>System.out.println(&quot;First Name is--&gt;&quot;+firstName);</pre><pre>Assert.assertEquals(firstName, &quot;George&quot;);</pre><pre>String LastName = TestUtil.getValueByJPath(responseJson, &quot;data[0]/last_name&quot;);</pre><pre>System.out.println(&quot;Last Name is--&gt;&quot;+LastName);</pre><pre>Assert.assertEquals(LastName, &quot;Bluth&quot;);</pre><pre>String email = TestUtil.getValueByJPath(responseJson, &quot;data[0]/email&quot;);</pre><pre>System.out.println(&quot;Email is--&gt;&quot;+email);</pre><pre>Assert.assertEquals(email, &quot;george.bluth@reqres.in&quot;);</pre><pre>String avatar = TestUtil.getValueByJPath(responseJson, &quot;data[0]/avatar&quot;);</pre><pre>System.out.println(&quot;Avatar value is--&gt;&quot;+avatar);</pre><pre>Assert.assertEquals(avatar, &quot;https://reqres.in/img/faces/1-image.jpg&quot;);</pre><pre>// 3. All Headers:</pre><pre>Header[] headersArray = closeableHttpResponse.getAllHeaders();</pre><pre>HashMap&lt;String, String&gt; allHeaders = new HashMap&lt;String, String&gt;();</pre><pre>for (Header header : headersArray) {</pre><pre>allHeaders.put(header.getName(), header.getValue());</pre><pre>}</pre><pre>System.out.println(&quot;Headers Array: &quot; + allHeaders);</pre><pre>}</pre><p>We need to create the Hash Map object inside this Test to pass the headers.</p><pre>HashMap&lt;String, String&gt; headerMap = new HashMap&lt;String, String&gt;();</pre><pre>headerMap.put(&quot;Content-Type&quot;, &quot;application/json&quot;);</pre><h4>Make sure you do it before you call the Get method from the Rest Client class.</h4><p>Now, To call the Get method with headers, we need to pass the header Map object along with the URL</p><pre>closeableHttpResponse = restClient.get(URL, headerMap);</pre><p>You can also set the priority of the Test cases.</p><pre>@Test(priority=1)<br>public void getTestWithoutHeaders()</pre><pre>@Test(priority=2)<br>public void getTestWithHeaders()</pre><p>Let’s run the code and see if both the test cases are executing properly.</p><pre>[RemoteTestNG] detected TestNG version 7.3.0</pre><pre>Status Code--&gt;200</pre><pre>Response Json from GET API--&gt;{&quot;per_page&quot;:6,&quot;total&quot;:12,&quot;data&quot;:[{&quot;last_name&quot;:&quot;Bluth&quot;,&quot;id&quot;:1,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/1-image.jpg&quot;,&quot;first_name&quot;:&quot;George&quot;,&quot;email&quot;:&quot;george.bluth@reqres.in&quot;},{&quot;last_name&quot;:&quot;Weaver&quot;,&quot;id&quot;:2,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/2-image.jpg&quot;,&quot;first_name&quot;:&quot;Janet&quot;,&quot;email&quot;:&quot;janet.weaver@reqres.in&quot;},{&quot;last_name&quot;:&quot;Wong&quot;,&quot;id&quot;:3,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/3-image.jpg&quot;,&quot;first_name&quot;:&quot;Emma&quot;,&quot;email&quot;:&quot;emma.wong@reqres.in&quot;},{&quot;last_name&quot;:&quot;Holt&quot;,&quot;id&quot;:4,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/4-image.jpg&quot;,&quot;first_name&quot;:&quot;Eve&quot;,&quot;email&quot;:&quot;eve.holt@reqres.in&quot;},{&quot;last_name&quot;:&quot;Morris&quot;,&quot;id&quot;:5,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/5-image.jpg&quot;,&quot;first_name&quot;:&quot;Charles&quot;,&quot;email&quot;:&quot;charles.morris@reqres.in&quot;},{&quot;last_name&quot;:&quot;Ramos&quot;,&quot;id&quot;:6,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/6-image.jpg&quot;,&quot;first_name&quot;:&quot;Tracey&quot;,&quot;email&quot;:&quot;tracey.ramos@reqres.in&quot;}],&quot;page&quot;:1,&quot;total_pages&quot;:2,&quot;support&quot;:{&quot;text&quot;:&quot;To keep ReqRes free, contributions towards server costs are appreciated!&quot;,&quot;url&quot;:&quot;https://reqres.in/#support-heading&quot;}}</pre><pre>Per Page value is--&gt;6</pre><pre>Total Pages value is--&gt;2</pre><pre>First Name is--&gt;George</pre><pre>Last Name is--&gt;Bluth</pre><pre>Email is--&gt;george.bluth@reqres.in</pre><pre>Avatar value is--&gt;https://reqres.in/img/faces/1-image.jpg</pre><pre>Headers Array: {Transfer-Encoding=chunked, Server=cloudflare, CF-RAY=6834cad6aaeede05-BOM, Connection=keep-alive, Date=Mon, 23 Aug 2021 13:47:22 GMT, via=1.1 vegur, access-control-allow-origin=*, CF-Cache-Status=REVALIDATED, Cache-Control=max-age=14400, NEL={&quot;success_fraction&quot;:0,&quot;report_to&quot;:&quot;cf-nel&quot;,&quot;max_age&quot;:604800}, Report-To={&quot;endpoints&quot;:[{&quot;url&quot;:&quot;https:\/\/a.nel.cloudflare.com\/report\/v3?s=aNz7wZze118AJtREaI9zFpDM9jz4ZdVLIw01IbGFImX6Oipj4HHtN1%2BshQHzu8GJl%2B73kQKEycCM%2F9d8o8IIyX7dht7dyZ0%2FKJ%2FxXVF7bMt0tXSqcPKMPsvrokk%3D&quot;}],&quot;group&quot;:&quot;cf-nel&quot;,&quot;max_age&quot;:604800}, x-powered-by=Express, etag=W/&quot;3e4-2RLXvr5wTg9YQ6aH95CkYoFNuO8&quot;, Vary=Accept-Encoding, alt-svc=h3-27=&quot;:443&quot;; ma=86400, h3-28=&quot;:443&quot;; ma=86400, h3-29=&quot;:443&quot;; ma=86400, h3=&quot;:443&quot;; ma=86400, Content-Type=application/json; charset=utf-8, Expect-CT=max-age=604800, report-uri=&quot;https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;}</pre><pre>Status Code--&gt;200</pre><pre>Response Json from GET API--&gt;{&quot;per_page&quot;:6,&quot;total&quot;:12,&quot;data&quot;:[{&quot;last_name&quot;:&quot;Bluth&quot;,&quot;id&quot;:1,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/1-image.jpg&quot;,&quot;first_name&quot;:&quot;George&quot;,&quot;email&quot;:&quot;george.bluth@reqres.in&quot;},{&quot;last_name&quot;:&quot;Weaver&quot;,&quot;id&quot;:2,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/2-image.jpg&quot;,&quot;first_name&quot;:&quot;Janet&quot;,&quot;email&quot;:&quot;janet.weaver@reqres.in&quot;},{&quot;last_name&quot;:&quot;Wong&quot;,&quot;id&quot;:3,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/3-image.jpg&quot;,&quot;first_name&quot;:&quot;Emma&quot;,&quot;email&quot;:&quot;emma.wong@reqres.in&quot;},{&quot;last_name&quot;:&quot;Holt&quot;,&quot;id&quot;:4,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/4-image.jpg&quot;,&quot;first_name&quot;:&quot;Eve&quot;,&quot;email&quot;:&quot;eve.holt@reqres.in&quot;},{&quot;last_name&quot;:&quot;Morris&quot;,&quot;id&quot;:5,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/5-image.jpg&quot;,&quot;first_name&quot;:&quot;Charles&quot;,&quot;email&quot;:&quot;charles.morris@reqres.in&quot;},{&quot;last_name&quot;:&quot;Ramos&quot;,&quot;id&quot;:6,&quot;avatar&quot;:&quot;https://reqres.in/img/faces/6-image.jpg&quot;,&quot;first_name&quot;:&quot;Tracey&quot;,&quot;email&quot;:&quot;tracey.ramos@reqres.in&quot;}],&quot;page&quot;:1,&quot;total_pages&quot;:2,&quot;support&quot;:{&quot;text&quot;:&quot;To keep ReqRes free, contributions towards server costs are appreciated!&quot;,&quot;url&quot;:&quot;https://reqres.in/#support-heading&quot;}}</pre><pre>Per Page value is--&gt;6</pre><pre>Total Pages value is--&gt;2</pre><pre>First Name is--&gt;George</pre><pre>Last Name is--&gt;Bluth</pre><pre>Email is--&gt;george.bluth@reqres.in</pre><pre>Avatar value is--&gt;https://reqres.in/img/faces/1-image.jpg</pre><pre>Headers Array: {Transfer-Encoding=chunked, Server=cloudflare, CF-RAY=6834cadc7a19de2d-BOM, Connection=keep-alive, Date=Mon, 23 Aug 2021 13:47:22 GMT, via=1.1 vegur, access-control-allow-origin=*, CF-Cache-Status=HIT, Cache-Control=max-age=14400, NEL={&quot;success_fraction&quot;:0,&quot;report_to&quot;:&quot;cf-nel&quot;,&quot;max_age&quot;:604800}, Report-To={&quot;endpoints&quot;:[{&quot;url&quot;:&quot;https:\/\/a.nel.cloudflare.com\/report\/v3?s=5OsMPIdJezCn76o9%2BkfuVMmFqsXaUdWgTPw5uBs8lU%2FpVuCVx001wzVnAmUjQf4kNhaS4IR%2BTHdbwe343crSHW2%2BnysEkGBP2V2EwwtxG5xlf6LF7JGKxGN7eTk%3D&quot;}],&quot;group&quot;:&quot;cf-nel&quot;,&quot;max_age&quot;:604800}, x-powered-by=Express, etag=W/&quot;3e4-2RLXvr5wTg9YQ6aH95CkYoFNuO8&quot;, Vary=Accept-Encoding, alt-svc=h3-27=&quot;:443&quot;; ma=86400, h3-28=&quot;:443&quot;; ma=86400, h3-29=&quot;:443&quot;; ma=86400, h3=&quot;:443&quot;; ma=86400, Age=0, Content-Type=application/json; charset=utf-8, Expect-CT=max-age=604800, report-uri=&quot;https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;}</pre><pre>PASSED: getTestWithoutHeaders</pre><pre>PASSED: getTestWithHeaders</pre><pre>===============================================</pre><pre>Default test</pre><pre>Tests run: 2, Failures: 0, Skips: 0</pre><pre>===============================================</pre><pre>===============================================</pre><pre>Default suite</pre><pre>Total tests run: 2, Passes: 2, Failures: 0, Skips: 0</pre><pre>===============================================</pre><p>Awesome!</p><p><a href="https://github.com/Premsing/APIsandHTTPClient">Here</a> is the Git repo for you to download the code.</p><p>Thanks for reading.</p><h4>Declaration: This article is based on one of the videos by <a href="https://medium.com/u/63406024ff34">Naveen AutomationLabs</a> and, the video link is below.</h4><p><a href="https://www.youtube.com/watch?v=mcUpHffY47A&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=5">https://www.youtube.com/watch?v=mcUpHffY47A&amp;list=PLFGoYjJG_fqp891lruz5fCRPWsDtEXJky&amp;index=5</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c150982eaa8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>