<?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: Dilpreet Johal</title>
    <description>The latest articles on DEV Community by Dilpreet Johal (@dilpreetjohal).</description>
    <link>https://dev.to/dilpreetjohal</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%2F426933%2F6f07189a-6d71-4451-a7f9-83e4ed93dd22.png</url>
      <title>DEV Community: Dilpreet Johal</title>
      <link>https://dev.to/dilpreetjohal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dilpreetjohal"/>
    <language>en</language>
    <item>
      <title>Common Cypress Interview Questions</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 04 Sep 2023 13:35:02 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/common-cypress-interview-questions-3h3a</link>
      <guid>https://dev.to/dilpreetjohal/common-cypress-interview-questions-3h3a</guid>
      <description>&lt;p&gt;Here's a quick overview at some of the common Cypress Interview questions you might face. &lt;/p&gt;

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

&lt;p&gt;Cypress is a user-friendly, end-to-end testing framework that uses JavaScript language. It works directly in the browser, making tests faster and more accurate as they mimic real user interactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Would You Differentiate Cypress from Selenium?
&lt;/h3&gt;

&lt;p&gt;While both are popular tools for web application testing, Cypress stands out due to its browser-based architecture and exclusive use of JavaScript, offering a more direct and real-time feedback experience than Selenium.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of Cypress?
&lt;/h3&gt;

&lt;p&gt;Cypress has some key unique features such as automatic waiting, real-time reloads, and simple debugging capabilities. It also offers visual testing and network traffic control which makes testing easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are the Steps to Install and Configure Cypress?
&lt;/h3&gt;

&lt;p&gt;To &lt;a href="https://sdetunicorns.com/blog/cypress-installation-setup/"&gt;setup Cypress&lt;/a&gt;, you just need few npm commands to install and start the Cypress Test Runner. And, then you can begin writing your tests&lt;/p&gt;

&lt;h3&gt;
  
  
  How Is a Basic Test Case Created in Cypress?
&lt;/h3&gt;

&lt;p&gt;Writing a basic test case is easy and straightforward -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;describe('Basic Test Case', () =&amp;gt; {
  it('should visit SDET Unicorns website and verify its title', () =&amp;gt; {
    cy.visit('https://sdetunicorns.com')
    cy.title().should('eq', 'Master Software Testing &amp;amp; Automation Online | SDET Unicorns')
  })
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How Does Cypress Manage Asynchronous Operations?
&lt;/h3&gt;

&lt;p&gt;Cypress has a unique approach to handling asynchronous operations. It uses its own commands that automatically manage the sequence of operations, removing the need for explicit waits in your tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can You Mention Some Common Commands Used in Cypress?
&lt;/h3&gt;

&lt;p&gt;Cypress offers a variety of &lt;a href="https://sdetunicorns.com/blog/cypress-commands-get-click-find/"&gt;commands&lt;/a&gt; that help you interact with the DOM and make assertions. Some commonly used commands include &lt;code&gt;cy.visit(url)&lt;/code&gt;, &lt;code&gt;cy.get(selector)&lt;/code&gt;, and &lt;code&gt;cy.click()&lt;/code&gt;, to name a few.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ready to Dive Deeper?
&lt;/h3&gt;

&lt;p&gt;If you're keen to diving deeper and explore more detailed interview questions, check out the full blog here - &lt;a href="https://sdetunicorns.com/blog/cypress-interview-questions-and-answers/"&gt;Top Cypress Interview Questions and Answers&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>testing</category>
      <category>interview</category>
    </item>
    <item>
      <title>Linux Command Line Essentials for Beginners</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 17 Apr 2023 13:36:11 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/linux-command-line-essentials-for-beginners-42h9</link>
      <guid>https://dev.to/dilpreetjohal/linux-command-line-essentials-for-beginners-42h9</guid>
      <description>&lt;p&gt;I am starting a new series where I’ll be diving into the essentials of the Linux command line for beginners. Before we jump into that, let’s go over why it’s important to learn command line as well as take a look at a brief history of operating systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Learn the Linux Command Line?
&lt;/h3&gt;

&lt;p&gt;If you’re new to this topic, Linux is a free and open-source operating system that powers everything from supercomputers to smartphones and smartwatches. The command line, or terminal, is the primary way we interact with and control Linux systems. You might be wondering, “Why do I need to learn this when I can just use the GUI (graphical user interface)?” Trust me, learning the command line is a fundamental skill in the software industry, with numerous advantages:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: The command line allows you to perform tasks quickly by typing commands. Once you become comfortable with the command line, you can navigate through directories, copy, move, and delete files or even perform batch processing on multiple files together much faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automation&lt;/strong&gt;: The command line lets you automate repetitive tasks, saving time and allowing you to focus on more important things. Examples include backing up files or directories, renaming files in batches, or scheduling tasks using cron jobs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Features&lt;/strong&gt;: Some features and settings are only accessible through the command line, giving you more control over your system. This enables you to perform tasks like running shell scripts or managing servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Versatility&lt;/strong&gt;: The command line can be used on various operating systems, including Linux, macOS, and Windows. Regardless of the platform, your command line skills will always be useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High Demand&lt;/strong&gt;: Command line skills are sought after by many companies for roles in software development, system administration, and network engineering. Learning the command line can open up a wealth of new job opportunities.&lt;/p&gt;




&lt;h3&gt;
  
  
  A Brief History of Operating Systems
&lt;/h3&gt;

&lt;p&gt;Before we jump into commands, let’s get a good grasp of the history of operating systems. We can group them into two main families: Windows and Unix/Unix-like systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  Unix and Unix-like Systems: The Early Days
&lt;/h4&gt;

&lt;p&gt;Unix was created in the late 1960s and is often seen as the starting point of modern operating systems. Developed at Bell Labs, Unix was designed to be easy to move around, handle multiple tasks, and support many users. Over time, Unix split into different versions, including commercial ones like Solaris and open-source options like Linux and FreeBSD.&lt;/p&gt;

&lt;p&gt;Linux, a Unix-like operating system, was made by Linus Torvalds in 1991. This open-source OS became super popular around the world, with many distributions like Ubuntu, Fedora, and Debian catering to different user needs. Its strength, flexibility, and affordability have helped it spread across servers, embedded systems, and personal computers.&lt;/p&gt;

&lt;h4&gt;
  
  
  Windows: The Friendly OS
&lt;/h4&gt;

&lt;p&gt;On the other hand, Microsoft introduced Windows in 1985 as an add-on to the MS-DOS operating system. Windows quickly became popular as a user-friendly, graphical operating system. It has gone through many versions, with the latest being Windows 11. Even though it’s mostly known for being on desktop computers, Windows has also made its way into servers and other embedded systems.&lt;/p&gt;




&lt;h3&gt;
  
  
  Similarities Between Unix-like and Windows Operating Systems
&lt;/h3&gt;

&lt;p&gt;When looking at commands, it’s important to know that Unix-like operating systems, like Linux and macOS, have a lot in common. They use a similar structure for directories and file permissions, and many command-line tools work similarly across these platforms. So, learning the command line on one platform helps you use that knowledge on another, making your skills super handy.&lt;/p&gt;

&lt;p&gt;By understanding the history of these operating systems, you’ll get a better feel for how the command line has grown and why it’s so important in computing. As we go through this series, you’ll see that your command line skills can be super helpful, no matter which platform you’re working with.&lt;/p&gt;




&lt;h3&gt;
  
  
  Check out this video to learn more –
&lt;/h3&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LlhJmav9024"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  Stay Tuned for More Linux Command Line Insights
&lt;/h3&gt;

&lt;p&gt;Don’t miss our upcoming videos, where we’ll start diving into the command line essentials. If you’re looking to kickstart your career in software development, software testing or DevOps, be sure to subscribe to the channel and follow along with this series.&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 Unleash Your Full Potential and Take Your Career to the Next Level with SDET-U Academy👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/sdet-u-academy"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bit.ly/dilpreet-twitter"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bit.ly/sdet-u-linkedin"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bit.ly/sdet-u-instagram"&gt;Instagram&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>testing</category>
      <category>beginners</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Postman Data Driven Testing using Newman CLI</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Thu, 02 Mar 2023 13:24:02 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/postman-data-driven-testing-using-newman-cli-2p11</link>
      <guid>https://dev.to/dilpreetjohal/postman-data-driven-testing-using-newman-cli-2p11</guid>
      <description>&lt;p&gt;API testing is a crucial aspect of modern software development, and data-driven testing is an effective technique to test APIs with varying input data. Newman CLI is a powerful tool that can be used to automate API testing and perform data-driven testing. Let’s see how we can do that –&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Newman CLI?
&lt;/h3&gt;

&lt;p&gt;Newman CLI is a command-line tool developed by Postman that allows you to run Postman collections from the command line. It provides a way to execute Postman collections in an automated and continuous manner, making it a popular tool for API testing and integration testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a Postman collection with the requests to be tested.&lt;/li&gt;
&lt;li&gt;Optionally, write tests for each request to validate the expected results.&lt;/li&gt;
&lt;li&gt;Export the collection so that it can be accessed by Newman CLI.&lt;/li&gt;
&lt;li&gt;Prepare a data file in CSV or JSON format to provide different input data for each test run.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  How to do Data Driven Testing using Newman CLI?
&lt;/h3&gt;

&lt;p&gt;To conduct data-driven testing with Newman CLI, you must execute the collection with the &lt;code&gt;newman run&lt;/code&gt; command and then use the &lt;code&gt;-d&lt;/code&gt; flag to provide the data file. Here’s an example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;newman run sample.postman_collection.json -d data.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command will run all the iterations and return similar results –&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QRTfJGbW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99b6zwt8c2twcrr2r4cn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QRTfJGbW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99b6zwt8c2twcrr2r4cn.png" alt="newman cli data driven test run" width="880" height="497"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  To learn more, check out the video below –
&lt;/h3&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/vmTyNFAmFAY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Data-driven testing is a powerful technique to test APIs with varying input data. Newman CLI is a powerful tool that can be used to automate API testing and perform data-driven testing. With Newman CLI, you can easily perform data-driven testing and catch bugs and issues early in the development cycle.&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 Unleash Your Full Potential and Take Your Career to the Next Level with SDET-U Academy👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>postman</category>
      <category>testing</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Data Driven Testing using JSON file in Postman</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 06 Feb 2023 12:38:03 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/data-driven-testing-using-json-file-in-postman-284k</link>
      <guid>https://dev.to/dilpreetjohal/data-driven-testing-using-json-file-in-postman-284k</guid>
      <description>&lt;p&gt;In this blog post, we’ll look at how to use a JSON file in Postman to conduct data-driven testing. This method is useful when testing a single endpoint with many sets of data. We will also look at how to access nested data in JSON using pre-requisite scripts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of JavaScript and Postman.&lt;/li&gt;
&lt;li&gt;a JSON data file that you can use as the test’s source.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Prepare your JSON data file
&lt;/h3&gt;

&lt;p&gt;To get started, gather all the data you’ll need for your tests into a single JSON data file. Here’s an example of the JSON data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
  {
    "email": "user1@example.com",
    "roles": ["admin", "user"],
    "profile": {
      "name": "User 1",
      "address": "123 Main St."
    }
  },
  {
    "email": "user2@example.com",
    "roles": ["user"],
    "profile": {
      "name": "User 2",
      "address": "456 Main St."
    }
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create a new Postman request
&lt;/h3&gt;

&lt;p&gt;Once the data is ready, you can create your Postman request for your endpoint. Replace the values in the request body with variables, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  {
    "email": "{{email}}",
    "roles": ["{{roles}}"],
    "profile": {
      "name": "{{name}}",
      "address": "{{address}}"
    }
  } 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup Tests
&lt;/h3&gt;

&lt;p&gt;Before you run the request, it’s important to set up your tests to ensure you receive the expected results. Here’s an example:&lt;br&gt;
&lt;/p&gt;

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

pm.test("Verify data", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.email).to.eql(data['email']);
    pm.expect(jsonData.profile.name).to.eql(data['profile']['name']);
    pm.expect(jsonData.profile.address).to.eql(data['profile']['address']);
    pm.expect(jsonData.profile.company).to.eql(data['profile']['company']);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run Collection
&lt;/h3&gt;

&lt;p&gt;To organize your requests, add the request to a collection in Postman and then import the JSON file. Postman will automatically map the data for you. Once that’s done, hit the ‘Collection Run’ button to see the results.&lt;/p&gt;

&lt;p&gt;You’ll notice that the nested JSON data didn’t get mapped properly as it’s not supported by Postman at the moment. To handle this issue, you’ll need to do custom mapping in the pre-request script, like this:&lt;/p&gt;

&lt;h3&gt;
  
  
  Handling Nested JSON Data in Postman
&lt;/h3&gt;

&lt;p&gt;One issue that you may encounter while working with Postman is the mapping of nested JSON data. Unfortunately, this feature is not supported in Postman at the moment. But, don’t worry! You can easily handle it by writing a custom mapping in the pre-request script.&lt;/p&gt;

&lt;p&gt;Here’s an example of how you can do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm.collectionVariables.set("name", data["profile"]['name']);
pm.collectionVariables.set("address", data["profile"]['address']);
pm.collectionVariables.set("company", data["profile"]['company']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following these steps, you can ensure that your tests run correctly and produce the expected results.&lt;/p&gt;




&lt;p&gt;Check out the video below for a detailed explanation&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/XM6kh_jnUSY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 Unleash Your Full Potential and Take Your Career to the Next Level with SDET-U Academy👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69" rel="noopener noreferrer"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list" rel="noopener noreferrer"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Postman Data Driven Testing with CSV file</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 23 Jan 2023 14:02:23 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/postman-data-driven-testing-with-csv-file-jo4</link>
      <guid>https://dev.to/dilpreetjohal/postman-data-driven-testing-with-csv-file-jo4</guid>
      <description>&lt;p&gt;Data-driven testing is a powerful technique for automating the testing process with Postman. By using a CSV data file, you can run the same test multiple times on different datasets, saving time and reducing the amount of code needed. In this tutorial, I will show you how to import a CSV file into Postman and use it for data-driven testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirements:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Postman and JavaScript&lt;/li&gt;
&lt;li&gt;A CSV data file as a source for your test&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Prepare your CSV data file
&lt;/h3&gt;

&lt;p&gt;The first step is to prepare your CSV data file. Make sure the column names match the variables you will use in your tests. In this case, we have columns for User ID, Title, and Body. Each row should contain data for one test case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9yy3ljxr2a8z91a1n7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9yy3ljxr2a8z91a1n7z.png" alt="csv file" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a new request and set up your test
&lt;/h3&gt;

&lt;p&gt;To create a new request in Postman, click on the "New" button and select "Request." In the request, you can set up your test by using variables from the CSV data file. For example, you can use the &lt;code&gt;userid&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, and &lt;code&gt;body&lt;/code&gt; variables in the request body to send different data for each test case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgijddmv8fpoplycaudzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgijddmv8fpoplycaudzs.png" alt="Postman Test" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a collection
&lt;/h3&gt;

&lt;p&gt;To organize your requests, add the request to a collection in Postman and then click on 'Run Collection' button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Import CSV Data file
&lt;/h3&gt;

&lt;p&gt;To use the data from your CSV file, import it into the Postman collection by clicking on 'Select File' button. This will map the data from the CSV file into a table. Make sure the mapping is correct before proceeding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjli4i05rmhd3h76uf8zi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjli4i05rmhd3h76uf8zi.png" alt="Preview data" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the collection
&lt;/h3&gt;

&lt;p&gt;With the collection set up and the CSV data imported, you can now run the collection by clicking on the 'Run Collection' button. This will automatically run each request in the collection, using the corresponding data from the CSV file for each test.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9sl7zpj11t31apufd63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9sl7zpj11t31apufd63.png" alt="CSV Test Run" width="800" height="849"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Check out the video below for a detailed explanation
&lt;/h4&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Hwmdq1fpbUA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;By using a CSV data file in Postman, you can easily perform data-driven testing and automate your testing process. This technique can save you time and effort by allowing you to reuse the same test with different data sets.&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to advance your career by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69" rel="noopener noreferrer"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list" rel="noopener noreferrer"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Test Automation with AI (ChatGPT) from scratch!</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Wed, 11 Jan 2023 14:10:58 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/test-automation-with-ai-chatgpt-from-scratch-o82</link>
      <guid>https://dev.to/dilpreetjohal/test-automation-with-ai-chatgpt-from-scratch-o82</guid>
      <description>&lt;p&gt;In the video below, I will be utilizing ChatGPT, to assist me in building test automation scripts using the Cypress framework. I will ask the chatbot five questions, each of which will become progressively more challenging in order to test its knowledge and capabilities.&lt;/p&gt;

&lt;p&gt;ChatGPT is a chatbot developed by OpenAI that utilizes a highly trained language model to interact with users in a natural, conversational manner. This text-based artificial intelligence tool has gained significant popularity in the tech industry for its ability to provide comprehensive answers to a wide range of questions, but it particularly excels at generating coding solutions on the fly.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/84O4_JqBqVE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to advance your career by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>Reading a CSV file in Cypress using fixture</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 02 Jan 2023 01:08:21 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/reading-a-csv-file-in-cypress-using-fixture-35ne</link>
      <guid>https://dev.to/dilpreetjohal/reading-a-csv-file-in-cypress-using-fixture-35ne</guid>
      <description>&lt;p&gt;In this tutorial, we will learn how to read a CSV (Comma Separated Values) file in Cypress for data-driven testing. Data-driven testing is a testing technique where the test inputs and expected results are read from a data source, such as a CSV file. This allows us to run the same test multiple times with different data sets, reducing the amount of code we need to write and maintain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Cypress and JavaScript&lt;/li&gt;
&lt;li&gt;Node.js and npm installed on your machine&lt;/li&gt;
&lt;li&gt;A CSV file to use as a data source&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Install the neat-csv package
&lt;/h3&gt;

&lt;p&gt;The first step is to install the &lt;code&gt;neat-csv&lt;/code&gt; package, which is a simple utility for parsing CSV files into JavaScript objects. Open a terminal and navigate to the root directory of your project. Then, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install neat-csv&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Read the CSV file
&lt;/h3&gt;

&lt;p&gt;Next, we will use a before hook to read the CSV file and convert it into an object. before hooks in Cypress are functions that run before each test in a test suite. In this case, we will use the &lt;code&gt;fixture&lt;/code&gt; method to read the CSV file, and then pass the contents to the neatCSV function to parse it into an object.&lt;/p&gt;

&lt;p&gt;Here is the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const neatCSV = require('neat-csv');
describe('Read CSV', () =&amp;gt; {
  let table;
  before(() =&amp;gt; {
    cy
      .fixture('contact.csv')
      .then(neatCSV)
      .then(data =&amp;gt; {
        table = data;
      })
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Use the data in a test
&lt;/h3&gt;

&lt;p&gt;Now that we have read the CSV file and converted it into an object, we can use the data in a test. In this example, we will visit a form on a website, and then use the data from the CSV file to fill in the form fields.&lt;/p&gt;

&lt;p&gt;First, we will use the &lt;code&gt;visit&lt;/code&gt; method to navigate to the form page. Then, we will use the &lt;code&gt;get&lt;/code&gt; method to find the form fields, and use the &lt;code&gt;type&lt;/code&gt; method to fill them in with the data from the CSV file.&lt;/p&gt;

&lt;p&gt;To make the test more interesting, we will use a random row from the table object each time the test is run. To do this, we will use the Math.random function to generate a random number between 0 and the length of the table object, and then use Math.floor to round it down to the nearest integer. This will give us a random index for the table array.&lt;/p&gt;

&lt;p&gt;Here is the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  it('Fill input fields using CSV data', () =&amp;gt; {
    cy.visit('https://practice.automationbro.com/contact/');
    const randomRow = Math.floor(Math.random() * table.length)
    cy.get('.contact-name input').type(table[randomRow]['name'])
    cy.get('.contact-email input').type(table[randomRow]['email'])
    cy.get('.contact-phone input').type(table[randomRow]['phone'])
    cy.get('.contact-message textarea').type(table[randomRow]['message'])
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Run the test
&lt;/h3&gt;

&lt;p&gt;Now that we have written our test, we can run it using the cypress run command in the terminal. If everything goes well, the test should run and fill in the form fields using data from a random row in the CSV file.&lt;/p&gt;




&lt;h4&gt;
  
  
  Check out the video below for a detailed explanation
&lt;/h4&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8h1pUyVHqn0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Access:&lt;/strong&gt; Full code can be accessed &lt;a href="https://subscribepage.io/cypress-csv"&gt;here&lt;/a&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;In this tutorial, we learned how to read a CSV file in Cypress for data-driven testing. By using the &lt;code&gt;neat-csv&lt;/code&gt; package and a &lt;code&gt;fixture&lt;/code&gt;, we were able to parse the CSV file into an object and use the data in a test. This technique can save us time and effort by allowing us to reuse the same test with different data sets by using a before hook.&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to advance your career by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Playwright with Typescript tutorial on FIFA World cup site</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 05 Dec 2022 13:19:22 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/playwright-with-typescript-tutorial-on-fifa-world-cup-site-1map</link>
      <guid>https://dev.to/dilpreetjohal/playwright-with-typescript-tutorial-on-fifa-world-cup-site-1map</guid>
      <description>&lt;p&gt;In this video, we will automate the FIFA world cup site using Playwright and Typescript. Let's do a quick overview on Playwright:&lt;/p&gt;

&lt;p&gt;Playwright is one of the most popular end-to-end automation tools in the market today. It works with multiple languages such as Typescript, JavaScript, Python, .Net, and Java. It supports all the major browsers, such as Chrome, Firefox, and Safari, and more. Getting started with Playwright is easy, with just a few steps you can have your first test running.&lt;/p&gt;

&lt;h3&gt;
  
  
  The video below will cover the following topics -
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup and installation:&lt;/strong&gt; We will go through the process of installing and setting up Playwright, as well as the necessary dependencies and tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project and config overview:&lt;/strong&gt; We will provide an overview of the project structure and configuration, including how to define and organize tests, and how to customize settings and preferences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Writing the first Playwright test:&lt;/strong&gt; We will show you how to write your first Playwright test, using Typescript and the Playwright API. This will include an introduction to the syntax and concepts, and a step-by-step guide to creating and running your first test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playwright page locator:&lt;/strong&gt; We will explain how to use the Playwright page locator, a powerful tool for identifying and selecting elements on a web page. 
Working with multiple elements: We will demonstrate how to work with multiple elements on a page and retrieve text from it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disabling HTML report:&lt;/strong&gt; We will show you how to disable the HTML report, which is a feature of Playwright that automatically generates an HTML report of your test results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playwright debugger / inspector:&lt;/strong&gt; We will introduce you to the Playwright debugger and inspector, which are powerful tools for debugging and inspecting your tests in real-time. This will include an overview of the different debugger and inspector features, and how to use them to diagnose and fix problems with your tests.&lt;/li&gt;
&lt;li&gt;And much more..&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Ov9e_F8I5zc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👩🏻‍💻 Access the source code &lt;a href="https://subscribepage.io/fifa-pw"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;To learn more about Playwright, check out my full course on Playwright here -&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://automationbro.com/playwright-course"&gt;https://automationbro.com/playwright-course&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to advance your career by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Automate One Time Password (OTP) using Cypress</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 14 Nov 2022 13:52:27 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/automate-one-time-password-otp-using-cypress-7h1</link>
      <guid>https://dev.to/dilpreetjohal/automate-one-time-password-otp-using-cypress-7h1</guid>
      <description>&lt;p&gt;Automating One Time Password (OTP) is always a bit challenging as you need to work with a third-party service to send/receive messages. Let's take a look at how we can do that using Cypress ...&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Dependencies
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://cypress.io/"&gt;Cypress&lt;/a&gt;: browser automation framework (can be replaced with any other JS browser automation framework)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://receive-smss.com/"&gt;Receive SMS&lt;/a&gt;: to generate a temporary phone number and receive SMS. Note: this can easily be replaced with a paid service such as Twilio, SMSArc, etc..&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt;: example site to test OTP on&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  In this video, we will cover step-by-step how to automate OTP using Cypress:
&lt;/h3&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/iiGy69gMeAw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👩🏻‍💻 Access the source code &lt;a href="https://subscribepage.io/otp-cypress"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;To learn more about Cypress, check out my free Cypress tutorial series here -&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=krpKuSqQ0XM&amp;amp;list=PL6AdzyjjD5HAr_Jq1hwpFUIO49uyBZ9ma"&gt;https://www.youtube.com/watch?v=krpKuSqQ0XM&amp;amp;list=PL6AdzyjjD5HAr_Jq1hwpFUIO49uyBZ9ma&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to advance your career by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Cross Browser Testing in Selenide</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 31 Oct 2022 12:41:26 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/cross-browser-testing-in-selenide-apn</link>
      <guid>https://dev.to/dilpreetjohal/cross-browser-testing-in-selenide-apn</guid>
      <description>&lt;p&gt;In this post, we will learn how to do cross-browser testing in Selenide. Selenide makes it really easy to be able to run tests on different browsers without having to do any additional configuration. Let’s take a look at how to do that –&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisite
&lt;/h3&gt;

&lt;p&gt;The one pre-requisite to run tests on different browser is to have Maven installed on the system so that you can execute tests and point to any browser of your choice. You can use the following links to setup Maven in macOS and Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Maven macOS Instructions&lt;/strong&gt;: &lt;a href="https://mkyong.com/maven/install-maven-on-mac-osx/"&gt;https://mkyong.com/maven/install-maven-on-mac-osx/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maven Windows Instructions&lt;/strong&gt;: &lt;a href="https://mkyong.com/maven/how-to-install-maven-in-windows/"&gt;https://mkyong.com/maven/how-to-install-maven-in-windows/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Verify Maven Installation:&lt;/strong&gt;&lt;br&gt;
Run &lt;code&gt;mvn -version&lt;/code&gt; to make sure maven is successfully installed in your machine.&lt;/p&gt;


&lt;h3&gt;
  
  
  Cross Browser Testing
&lt;/h3&gt;

&lt;p&gt;Once you have Maven installed, you can start to run Maven commands and specify the browser you want to run tests on –&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mvn test -D selenide.browser=firefox -D test=HomeTest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command will run the &lt;code&gt;HomeTest&lt;/code&gt; file in the Firefox browser. You can even pass in additional flag to the Maven command such as running tests in headless browser –&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mvn test -D selenide.browser=firefox -D selenide.headless=true -D test=HomeTest&lt;/code&gt;&lt;/p&gt;



&lt;p&gt;To learn more, check out the video below –&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/EYv8c-94MRA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to begin your SDET journey by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>java</category>
      <category>testing</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Cypress Variables | How does it work?</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Tue, 25 Oct 2022 14:58:06 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/cypress-variables-how-does-it-work-1ip3</link>
      <guid>https://dev.to/dilpreetjohal/cypress-variables-how-does-it-work-1ip3</guid>
      <description>&lt;p&gt;In this tutorial, we will learn how to handle variables in Cypress. Dealing with variables in Cypress is not as straightforward as it seems due to the way Cypress work with promises. Let’s take a look at it –&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the problem
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  it("gets the text of the heading and assert the value", () =&amp;gt; {
    // get the text
    cy.get("h1.elementor-heading-title").then(($heading) =&amp;gt; {
      expect($heading.text()).to.eq("Think different. Make different.");
    })
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, we are trying to get the text of the element and then do an assertion on it. What if you want to use the heading text outside the &lt;code&gt;cy.get&lt;/code&gt; block, how can you do that? Simply, creating a variable like this would not work –&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  it("gets the text of the heading and assert the value", () =&amp;gt; {
    let headingText = '';
    // get the text
    cy.get("h1.elementor-heading-title").then(($heading) =&amp;gt; {
      headingText = $heading.text()
      expect($heading.text()).to.eq("Think different. Make different.");
    })
    // X - would print just an empty string
    console.log(headingText); 
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason &lt;code&gt;console.log&lt;/code&gt; would not print anything is because it will get printed even before the &lt;code&gt;cy.get&lt;/code&gt; command gets executed as &lt;code&gt;cy.get&lt;/code&gt; is an &lt;code&gt;async&lt;/code&gt; command. So we need a way to wait for the &lt;code&gt;cy.get&lt;/code&gt; command to be completed first and then print out our text.&lt;/p&gt;




&lt;h3&gt;
  
  
  Handling Variables in Cypress
&lt;/h3&gt;

&lt;p&gt;There’s 2 ways you can handle variables within a test block in Cypress.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accessing variable within the same block&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  it("gets the text of the heading and assert the value", () =&amp;gt; {
    // get the text
    cy.get("h1.elementor-heading-title").then(($heading) =&amp;gt; {
      let headingText = $heading.text()
      expect($heading.text()).to.eq("Think different. Make different.");
      // Use the heading text value here
      console.log(headingText);   
    })
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one is pretty straightforward as you can continue to created nested blocks within the same block as long as you need access to that context or variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accessing variable outside the block&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  it("gets the text of the heading and assert the value", () =&amp;gt; {
    // get the text
    cy.get("h1.elementor-heading-title").then(($heading) =&amp;gt; {
      let headingText = $heading.text();
      expect($heading.text()).to.eq("Think different. Make different.");

      // return the text so it can be used in .then as a parameter
      return headingText; 
    }).then(hText =&amp;gt; {
      // hText param holds the value of the above returned text
      console.log(hText);
    })
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the &lt;code&gt;.then&lt;/code&gt; block, you can access the previously returned value and then pass it as a parameter to the &lt;code&gt;.then&lt;/code&gt; block. This way you can keep chaining multiple methods together if it’s within the same context.&lt;br&gt;
Important thing to notice here is that it will only work with &lt;code&gt;.then&lt;/code&gt; block not &lt;code&gt;.should&lt;/code&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  To learn more, check out this video below –
&lt;/h3&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JAhpzF4WEZM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to begin your SDET journey by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Page Object Model – Selenide Tutorial Series</title>
      <dc:creator>Dilpreet Johal</dc:creator>
      <pubDate>Mon, 10 Oct 2022 13:38:59 +0000</pubDate>
      <link>https://dev.to/dilpreetjohal/page-object-model-selenide-tutorial-series-g3g</link>
      <guid>https://dev.to/dilpreetjohal/page-object-model-selenide-tutorial-series-g3g</guid>
      <description>&lt;p&gt;In this tutorial, we will cover how to implement Page Object Model in Selenide. Page Object Model is a popular design pattern to improve code readability and maintainability as well as to reduce duplicacy in your code. Selenide makes it really to get Page objects setup, let’s take a look at how we can do that –&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup Page Class
&lt;/h3&gt;

&lt;p&gt;We first need to setup a page class where we can store all our page locators and page methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class HomePage {
// add locators and methods here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Setup Page Locators
&lt;/h3&gt;

&lt;p&gt;Once base page class is setup, we can start adding the Page locators to the class –&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class HomePage {
    public SelenideElement getStartedBtn() {
        return $(By.id("get-started"));
    }
    public SelenideElement headingTitle() {
        return $("h1");
    }
    public SelenideElement logoLink() {
        return $(By.xpath("//a[@class=\"custom-logo-link\"]"));
    }
    public ElementsCollection linksList() {
        return $$("#primary-menu li[id*=menu-item]");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Make sure to import all the necessary packages from Selenide if auto-import doesn’t work.&lt;/p&gt;




&lt;h3&gt;
  
  
  Setup Page Methods
&lt;/h3&gt;

&lt;p&gt;Now that we have the page locators setup, we can start adding in necessary page methods to reduce code duplicacy –&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    public HomePage open() {
        Selenide.open("https://practice.automationbro.com/");
        return this;
    }
    public void assertUrl(String expectedUrl) {
        String url = WebDriverRunner.url();
        assertEquals(url, expectedUrl);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Update Tests to use POM
&lt;/h3&gt;

&lt;p&gt;In your test file, you need to initialize the HomePage class and then start replacing your locators and adding in page locators as well as page methods. Here’s an example –&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    @Test
    public void testInteractingWithElements() {
        // Open page url
        home
            .open()
            .assertUrl("https://practice.automationbro.com/");
        // By ID
        home.getStartedBtn().click();
        // verify heading by CssSelector
        home.headingTitle()
            .shouldHave(text("Think different. Make different."));
        // verify by XPath
        home.logoLink()
            .should(be(visible));
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As seen above, in just few steps you can implement Page object model concepts in Selenide. To learn more, check out this video below –&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Yf4dj2y2H1o"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;👩🏻‍💻 It's time to begin your SDET journey by joining the SDET-U Academy today 👇🏻&lt;br&gt;
&lt;a href="https://bit.ly/3Vcqv69"&gt;Join Academy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📧 Subscribe to my &lt;a href="https://automationbro.com/mailing-list"&gt;mailing list&lt;/a&gt; to get access to more content like this as well as be part of amazing free giveaways.&lt;/p&gt;

&lt;p&gt;👍 You can follow my content here as well - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/automationbro"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/company/automation-bro"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>java</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
