API Testing with Postman Workshop

Rate this content

In the ever-evolving landscape of software development, ensuring the reliability and functionality of APIs has become paramount. "API Testing with Postman" is a comprehensive workshop designed to equip participants with the knowledge and skills needed to excel in API testing using Postman, a powerful tool widely adopted by professionals in the field. This workshop delves into the fundamentals of API testing, progresses to advanced testing techniques, and explores automation, performance testing, and multi-protocol support, providing attendees with a holistic understanding of API testing with Postman.

1. Welcome to Postman

- Explaining the Postman User Interface (UI)

2. Workspace and Collections Collaboration

- Understanding Workspaces and their role in collaboration

- Exploring the concept of Collections for organizing and executing API requests

3. Introduction to API Testing

- Covering the basics of API testing and its significance

4. Variable Management

- Managing environment, global, and collection variables

- Utilizing scripting snippets for dynamic data

5. Building Testing Workflows

- Creating effective testing workflows for comprehensive testing

- Utilizing the Collection Runner for test execution

- Introduction to Postbot for automated testing

6. Advanced Testing

- Contract Testing for ensuring API contracts

- Using Mock Servers for effective testing

- Maximizing productivity with Collection/Workspace templates

- Integration Testing and Regression Testing strategies

7. Automation with Postman

- Leveraging the Postman CLI for automation

- Scheduled Runs for regular testing

- Integrating Postman into CI/CD pipelines

8. Performance Testing

- Demonstrating performance testing capabilities (showing the desktop client)

- Synchronizing tests with VS Code for streamlined development

9. Exploring Advanced Features - Working with Multiple Protocols: GraphQL, gRPC, and more

Join us for this workshop to unlock the full potential of Postman for API testing, streamline your testing processes, and enhance the quality and reliability of your software. Whether you're a beginner or an experienced tester, this workshop will equip you with the skills needed to excel in API testing with Postman.

48 min
20 Dec, 2023


Sign in or register to post your comment.

Video Summary and Transcription

This workshop on API testing with Postman covers a wide range of topics, including creating workspaces and collections, working with variables and dynamic data, testing syntax and methods, building workflows, automating testing with Postman CLI and Postbot, and advanced testing techniques. Postman provides extensive documentation, resources, and tools like Postbot for generating tests and documentation. The workshop also highlights the versatility of Postman in supporting various protocols and types of testing, such as contract testing, performance testing, and regression testing.

Available in Español

1. Introduction to API Testing with Postman

Short description:

Hello and welcome to this session about API testing with Postman. Today's session I'll be walking through a lot of different aspects of testing with Postman and hope to share some things that you might not be aware of. We'll talk about Postman's UI and how to get started with testing, learn advanced techniques, demo interesting features, and share additional resources. Postman is a versatile platform for API testing used by over 25 million people worldwide. It simplifies each step of the API life cycle and streamlines collaboration. You can work and create APIs faster, discover, evaluate, test, deploy, observe, define, develop, secure, and distribute APIs. We'll walk through the entire UI and get started with working with variables, understanding testing, advanced techniques, and automation.

Hello and welcome to this session about API testing with Postman. My name is Pooja Mistry. I'm a developer advocate and I'm excited to be sharing this workshop content with you. Today's session I'll be walking through a lot of different aspects of testing with Postman and hope to share some things that you might not be aware of.

So we'll be going through a workspace and collection and giving you a overall overview of Postman and some things you can do while testing when it comes to Postman. So just introducing myself. I've worked in the DevRel, DevAdvocacy space for about three years now and I'm excited to be educating others and sharing information specifically regarding to Postman.

So in today's agenda we'll be going through is we'll talk about Postman's UI and we'll kind of understand the terminology for those of you who are new to the platform. And we'll talk about how to get started with testing with Postman and learn some advanced testing techniques. And I'll be demoing some interesting features for you to kind of take a look at that you can get started on your testing journey. And then I'll be sharing a lot of additional Postman resources.

So essentially for those of you who are not familiar with Postman, Postman is a versatile platform for API testing and it's over used by over 25 million people worldwide. So if you're learn interested in learning a little bit more about Postman and its statistics, we have the Postman state of the API report which you can Google and you can get a lot more information on statistics around APIs and API development. So with Postman, Postman simplifies each step of the API life cycle and it streamlines collaboration so you can work and create APIs faster. It's an interface for both the producer and the consumer life cycle and it allows, you know, users to not only discover, evaluate, test, deploy, and observe, but they are also able to define and develop their APIs and secure them and distribute them accordingly. So it is trying to be this all-in-one life cycle and we'll walk through the entire UI and kind of how to get started with it. So essentially we are going to kind of get into things like working with variables, understand how testing works, learning some sort of advanced testing and automation techniques, building additional, and then I'll be sharing some additional Postman resources.

So to get started, feel free to take a look at this link where we'll be going through this workshop. So this is for I guess the TestJS summit that we were at previously, that is part of GitNation and we should be able to kind of go through Postman in that way. So I'm going to go ahead and get started and kind of show you what the Postman UI and the workspace looks like. So in this case, we are in this workspace and we have a public workspace. So within Postman, you can create different workspaces. Workspaces allow you to work and they're a template for you to get started. You can look at some of the templates that we have available. For example, you can always create a blank workspace, but if you're interested in some of our templates that we have available, if you're an API producer or an API tester, you may be interested in some of these templates. Like for example, this is a specific template associated to API testing. I'm going to go ahead and take a look and kind of show you this workspace, which is a public workspace. So this workspace, if I share the link with you all, you should have access to some of the collections that are available in this workspace to get started with. And the idea here is that you would like to go ahead and fork a collection to get started with in this specific workspace. So for example, since this is a public workspace, I might be interested in creating a, let's say I create a API testing workspace and call it API testing.

2. Creating Workspace and Forking Collection

Short description:

I'll create a workspace with a template and fork my first folder into my API workspace. This allows for collaboration and the ability to submit changes through pull requests. Forking enables working in our own environment for experiments and testing.

I can create that workspace, which it gives me access to my specific team members, whether that's my team or if it's personal or partner or public in that case. So I'll go ahead and create that workspace just so you know what it looks like to create a workspace with a template. And in a template workspace, we have some pre-created collections. Like for example, we have a collection for contract testing, integration testing. We have a collection to help you get started for writing basic tests, mocking data, performance testing, and then even regression testing. So we'll walk through some of these testing examples in this workspace, but for the most part, I'm going to go ahead and go back to my home page where my workspace exists. And I'll take a look at the workshop that we've created. And I'll go ahead and fork my first folder, which is an introduction to testers into my API workspace to get started with that workspace. So let me go ahead and create that fork and you can see that I'm able to then figure out which workspace I'd like to go ahead and fork that to. And I can always watch the original collection in the original workspace to get some more ideas on how to kind of to see if there's any changes. So for those of you who collaborate with your teams, this is very important because it allows one subject of truth, which is your main workspace that you work with. And then for just like how GitHub is created, you want to create a fork of that repository or a fork of that collection. And then if you want to submit any changes, you can always submit pull requests into a workspace similarly. So this is what allows for higher level of collaboration. So I'm going to go ahead and fork that collection and it should be able to you should see that I can once I create the fork in my API testing, it should be able to, you could see that that fork was created. So in this case, the reason why we wanted fork is to work in our own environment in case we want to do any experiments and testing. Since I own the original workspace, I will be able to send scripts and things like that through that. But since it's a public workspace, you would like need to fork to even send your requests.

3. Introduction to Collections and Variables

Short description:

To get started, let's take a look at how to create collections in Postman. We also have templates available for different roles, API use cases, and industries. Variables play a crucial role in Postman, allowing for reuse and storage of values. They can be used throughout your collection, environment variables, requests, and test scripts. Postman supports global variables, collection variables, and environment variables. Environment variables are especially useful for testing different environments. Collection variables are scoped to the collection level and are independent of environment variables.

So to get started, I wanted to kind of show you a couple of very intro testing aspects. So when it comes to testing and Postman, we have collections, and we can always create new collections. And another place where we can take a look at how to create collections is by taking a look at some of the templates that we have available.

So for example, we also have templates available for anybody that is based on roles, based on API use cases based on industries. So for example, if you were interested in artificial intelligence and wanted to take a look at some of the APIs available, we have entire collections that help you get started easier and if you don't want to start from scratch. But in our case, I wanted to show you some examples of what our collection looks like.

And then the first thing that I wanted to share about a folder in our collection is all about getting started with variables. So variables are a very important aspect of Postman and they allow for a lot more reuse and store of values. So by storing values as a variable, you can reference it throughout your collection, your environment variable, your requests, your test scripts, and variables help you work efficiently and collaborate with teammates a lot more dynamically. And you're able to set up a little bit more dynamic use cases when it comes to working with variables.

So in this case, I wanted to share that Postman has the ability of global variables, which are variables that you can use throughout your workspace, collection variables, which are specific to your entire collection. So in this case, I have variables that are specific to this collection and these folders and these requests. I can create environment variables. So global variables are that scope through the workspace. Environment variables are variables that I can export out and I can share. So, for example, if I wanted to call this like the new test environment and I wanted to use a base URL here. And let's say I have a production environment that has a different base URL. I can create multiple environment variables if I wanted to. So, for example, like I could add another environment variable here and I can call this one new production environment and have another variable value, for example, base URL here. And I can either set that as a default or a secret, which will encrypt my values here. So, for example, if I had specific API keys or API tokens, I can work with different variables as associated. And so based on the environment that I'm interested in, I can kind of work on either a production or test environment. So you can see that these environment variables are very useful when it comes to testing. So that's kind of what it looks like to kind of get scoped. So if we were to take a look at our request in itself. So here we have a ECHO URL, which is using our URL for the Postman ECHO service. And it is scoped to the collection variable. So you can see that that base URL for that ECHO URL is scoped to the collection level. And they're available throughout the requests and they're independent of environment variables. So basically, collection variables don't change based on the selected environment.

4. Working with ECHO API and Dynamic Variables

Short description:

I'll show you an example using the ECHO API, which always sends back the data you've sent. I've added query parameters for the first value and a random color. Postman's inbuilt library has a global dynamic variable that allows you to use random values.

So I'm going to go ahead and take a look at this ECHO example and kind of show you a little bit about what it looks like to kind of work with a request. So with ECHO, you can use this as a testing API because what it does is it always just sends back some data that you've sent it. So here I've added two query parameters, one of the first value and of a random color. So here you can see that I have a variable set for value one. And then I have a dynamic variable here set, which is part of Postman's inbuilt library. And this is globally across every workspace. And you can see that this is a random variable that you can kind of take a look at in terms of like it's it allows you to put in any random values.

5. Postman Learning Center and Dynamic Variables

Short description:

I'll share the Postman learning center, which contains documentation on all of our features, including dynamic variables. These variables, such as timestamps, random colors, and two-letter languages, are globally inbuilt into Postman, making testing and mock testing easier without the need to import external libraries.

So I wanted to share with you the kind of the Postman learning center. And so let me just kind of just make sure that I am so much interactive. Okay. So if we were to go to the Postman learning center, this is where all of our documentation exists. And so we have documentation on all of our our features. So if I were to take a look at dynamic variables. I can take a look at some examples here where I can use variables that are globally inbuilt into Postman, such as timestamps, random colors, text integers, random passwords, random, you know, two letter languages. So this is very useful when it comes to testing and doing any mock testing. And for a lot of people that do testing in other ways, they try to import these libraries. But this is a really interesting feature within Postman that is available directly as a variable.

6. Working with Variables in Postman

Short description:

To get started working with random features, use the dollar sign and random variables. In the request, there are pre-request and test scripts. The pre-request script uses pm.collectionVariables.set to work with variables. Initial values and current values differ in what gets saved when sharing the collection. Current values are set locally, while initial values are ideal for sharing.

So to get started working with some of these random features, all you have to do is make sure that you have that dollar sign. And then you can take a look at any of these random variables to create dynamic use cases. So in our request itself, we have two sets of scripts. So we have a pre request script and a test script. So within the pre request script, we can use this thing called pm dot collection variables dot set. So here we have a set of snippets that are available. So for example, we can use snippets such as, you know, clearing variables getting and setting collection variables, sending a request. So these are all snippets that allow you to work specifically with variables, for example, if you wanted to get a specific variable, or set a specific variable. So if I were to set this variable as blue and save this request, you can see that when I for that first value, um, I am going to go ahead and once I send that request, you can see that has changed because my current value has changed. So when it comes to working with variables, especially on the collection level side, there's initial values and current values. And so the difference between both initial and current value is basically, which values will get saved when you share, share the the collection with others. So, for example, ideally, you'd want to keep your initial values, if you were going to go ahead and export and share that collection with others for security reasons, and you don't want to share like your API keys, etc. So whatever is set in your current value is what is being set when you locally work with that particular collection at that time. So that is a little bit more insight into working with variables.

7. Testing Syntax and Methods

Short description:

In the test tab, you can write dynamic scripts and build workflows. The PM dot test methods allow you to make assertions and validate parameters and timestamps. Postman uses the chai assertion BDD syntax library for readable and reusable tests. To validate data returned, use the p.m. dot response method in a test and the p.m. dot test function to create tests. The expects syntax allows for specific assertions. These are some basic syntax and test methods and functions.

And that way, we also have the test tab. And this is where all of your tests exist. So you can write tests such as like, you know, testing if your status code is 200. So in this case, you can see that you are getting a passing test. But this is your place for writing some a lot more dynamic scripts, and building some workflows.

So let's take a look at a little bit of our basic testing syntax. So here, you're going to take a look at this example where we're working with the PM dot test methods, which allow you to basically make assertions and write tests that validate whether or not certain parameters are met and whether or not certain timestamps are met.

So like I mentioned, pre request scripts are you and test scripts allow you to write API tests and build requests that contain some sort of dynamic parameter. The postman runtime is based on node j s. So it's using the chai assertion BDD syntax library, which allows you to recreate optimize readable and reusable tests. So in this case, when we're taking a look at the basic syntax test, you can take a look at the adding set and get values. So for example, here, I am setting this value back to red, if I send this variable, I have a test here that I am, you can send the name of the first test, which is testing the response, you can send the name of the second test. And then here I have a specific test that is validating some sort of string within my response.

So for example, I'm using p.m. dot response text to include the value red. So if I were to, for example, change this, I should be able to see a failing test, because it's not getting that assertion. So when it comes to testing within postman, what you definitely care about is being able to validate the right, the right values here. So to validate the data returned, you can use the p.m. dot response method object in a test. And then to create a test, you want to use the p.m. dot test function, which allows you to provide a name and a function which returns some sort of Boolean value of true and false, whether or not that test has passed or that test has failed. So this is kind of how you would want to structure your tests.

So here again, I am also taking a look at the expects syntax. So if you're trying to structure specific assertions, there's a variety of ways, depending on your logic and your reference term of how you might want to output that result. So for example, here, you might want to use an expects to see some sort of expectation. So in this case, it is expecting we're having a failed test, because it's expecting that your status code is 201 rather than 200. You can use, like, you know, for example, these are all parameters that are expected to fail just to kind of show you how the p.m. dot expect function works, which is kind of a function that is testing some sort of logic. So these are some basic syntax and test methods and functions. Of course, you can take a look at some of the snippets that we have available.

8. Snippets for Testing and Validation

Short description:

We have snippets for response body, successful post requests, status code, and schema validation. They can help you get started with your tests and meet specific environment requirements.

We have snippets here for basically, you know, response body contains a string. So like if I were to add some more snippets in here, I can take a look at some snippet here that shows that this is supposed to contain a specific string. I have snippets that are testing specific successful post requests. I have snippets for testing status code. And I also have some sort of schema validation snippet to validate my entire schema and all the various types that I might have available here. So I'll take a I'll give you a little bit deeper insight into what that looks like. But you have some of these snippets to help you kind of get started with a lot of your your tested and you can use these curated list of commonly used test code snippets to meet any of your specific environments.

9. Building a Workflow with Variables and Scripts

Short description:

I'll show you how to build a workflow by using variables and scripts from one request to another. For example, you can set specific IDs, select genres, and create validations. You can also test getting a book by a single ID and validate the response. Additionally, you can use variables for your book title and send random data to your library. Write tests specific to your POST request, and validate the API response. Your library workspace and APIs are now part of a specific API workflow.

So I wanted to kind of show a couple of ways to now kind of dive a little bit deeper into building a workflow. So once you have a deeper understanding of testing at the basic level, you can kind of build an entire workflow of tests.

So for example, here, I have my library API reference books. And I can use some of the workflow that I have available to kind of test for specific books. So in this case, I have a URL where I have an API that gets gets a library reference of various books that I might be interested in.

So here, if I take a look at some of the tests I have available, I am trying to get the first book. And I'm setting that first book ID as a collection variable. So if you if you see that I've tested this, you can see that that first book's ID is now set as a collection variable. So I can also use the console log to validate specific things.

So for example, here, I'm validating the genre of my first book. So if I use the console log, you can see that I am trying to validate one that one of my genres of my first book in my library includes the genre fiction. So you can see that that ID was saved and that genre was specifically saved. So I'm here once I have this genre, I'm able to write a test here that is expecting that my response includes that specific genre. And so here, I can see that I have a test that I want to validate that my body of my data includes the genre fiction. So as you can see, I can create a specific test to kind of, you know, set specific IDs, select the genre, and create some sort of like validation here.

So maybe one of the reasons why I have set my ID in my first test is because for my second request in my collection, I am actually getting a book by a specific ID. So here, you can see that I want to get that book by that, I want to get that first book and test that I'm able to get the first book in my collection because I want to test this API that allows me to get a book by a single ID versus getting all my books. So here, if I were to test, you can see that I am able to get that specific book by that specific ID. And I can test that my API works here as well. So I can, you know, validate here that we are able to get that book by that ID. And I have a test now that I have been able to test that shows that I can validate that specific book by that ID.

So as you can see, you're using variables and scripts from one request to another to build an entire workflow. So now if you have a POST request in here, where you are, you know, you're using variables for your book title, you're using maybe if you're trying to send some random data into your library. So for example, I'm sending a book called Intro to Algorithms as a part of my title. And I want my author just because I want to test my API to have a bunch of random author full names. And I want to write a couple of tests that are specific to my POST request. So for example, I'm here, I'm writing a test that is specific to, you know, my POST requests that equal 200 or 201. So if I send these, this API request, you can see that I have some test results that validate that API. And now when I go back to my GET books, I you can see that my first book was that Intro to Algorithms book that I had initially posted with my POST request, with that author, and it has its own ID. So you can see that my library workspace, or my library APIs are now being set into a specific API workflow.

10. API Testing Workflow and Collection Runner

Short description:

I have a test to specifically test for a book, including patch requests and deletion. We've gone through all aspects of the CRUD methodology in API testing, using test scripts and collection variables to build workflows. There are endless possibilities when working with Postman, such as chaining requests, setting asynchronous requests, and looping over tests with conditional logic. The collection runner allows you to run tests in a sequential way, log request results, and pass data between requests. You can customize the order, iteration, and delays of your tests.

So here again, I have a test to specifically test for that book, I can test my patch request, where I am, you know, adding a checked out element. And then I can, of course, so here, if I am patching that my checked out is true. And let's run back for that, I should expect that one of my books in here, maybe this is not the right ID, but it is checked out as true. So for example, this is taking the ID of the first book, which was this, one of these books here that I set up. And you can see that that checked out element is now true. And then of course, I can delete that book by that specific ID. And I can see that, you know, see the whole API CRUD lifecycle. So here we have gone through reading, writing, through reading data, writing data, deleting data, we've gone through all of the CRUD methodology of working with APIs and how to kind of test and validate using some of the test scripts and then using things like collection variables, getting and setting to ultimately build a workflow. And I wanted to share this blog with you all, because this blog is interesting in the sense that there's a lot of ways to build workflows in Postman. So the possibilities are kind of endless when it comes to working with Postman. You can, in this case, we were chaining maybe different requests. So you can take a look at like what it looks like to chain requests. So if I had all of these APIs, I can chain them by setting and getting variables. I can set asynchronous requests as well. So for example, I can use the pm.send request. So in this example, I'm sending another API within the API. So I'm sending multiple APIs within the tests of an API should show what it looks like to send asynchronous requests. And then ultimately, I can also loop over test using some sort of conditional logic as well. So here I talk a lot about the collection runner, which allows you to ultimately run your tests in a sequential way. So if we were to take a look at our library reference, which are all of those tests that we've written here. We can now take a look at the collection runner, which enables you to run a collections request in a specified sequence that allows you to test the functionality of your API. And ultimately, what it does is it logs your request as test results. And you can use scripts to pass data between requests and alter the request workflow. So let's take a look at what the collection runner looks like. So here, if I were to take a look at my test, there's this run button here. So in this case, I can set the order of my tests, and I can run these manually. I can set the iteration. And I can also set any specific delays. So here, it looks like you can see that each of these requests have been run. And you can see that all of the tests, you can see all of the pass and the fail.

11. Automating Testing and Introducing Postbot

Short description:

You can automate testing in Postman by using features like scheduled runs, performance testing, and the Postman CLI. These allow you to trigger runs at specific frequencies, configure collections for different environments, and set up CI/CD pipelines. Additionally, Postman has introduced a new tool called Postbot, which uses generative AI elements to write tests. Postbot can be used to add tests to requests, fix syntax errors, and generate tests based on natural language commands. It can also visualize responses, such as generating tables based on specific properties using CSS and the pm.visualizer.set function.

So for example, if you wanted to view the summary, you can see which tests have passed, which tests have failed within your collection runner. And you can see ultimately, like how you can build an entire like test iteration within Postman. So with Postman, you can see like some of it logs exactly what times you've ran this test. And you can see all the tests that have passed all the tests that have passed all the tests that have failed. And you can also take a look a little bit at the results as well.

So we also have you know, within Postman, you can do a little bit of scheduled runs, performance testing. So for example, scheduled runs, they allow you to trigger your run. So for example, here, if I were to do a scheduled run, I can set a frequency. So like every minute, run all of these collections, you know, or every five minutes, run these collections and set these iterations and send an email notification drive. You can also run these by using the Postman CLI. So the Postman CLI is actually really useful when it comes to building a workflow and and running your specific collection on some sort of CI CD pipeline. So for example, if you wanted to configure that particular collection, and you wanted to run it on Jenkins or CircleCI, GitLab, TravisCI, you can set that at various different operating systems, and you can set various environments. So for example, here, I wanted to run this using my test environment, my test URLs, my test API keys, my test access tokens, or if I want to run this in a production environment or staging environment. So you you can set up entire CI CD CLI pipelines, and you can see that it sends the command here and it allows you to generate a Postman API key to to run that specific collection.

So those are some ways to automate your your use of testing, but the idea here is to understand how variables work, understand the basics of scripting, and then understand how you can build entire workflows. And so once you kind of have a deeper understanding of a lot of that, I wanted to show you a new tool called Postbot that has recently come out, and it's brand new to Postman, that is available at least on the free plan, which allows you to use some of our generative AI elements to write tests. So I wanted to first go off and introduce Postbot, which is our new AI assistant and allows you to use natural language to create tests within your workspace. So here I have a API, for example, that is getting some dad jokes. I can use Postbot, which is on the bottom to go ahead and add tests to this request. And you can see that it is adding all of the tests. For example, it's expecting to have specific properties, expecting for some things not to be empty, and you can see that you can also fix specific scripts to evaluate your tests here. So it's fixing specific syntaxes, and it's writing the test for you. So for example, you can, in this case with my library example, I'm going to delete all of this. I can use Postbot. So for example, I'm going to say, write me a test to test that one book. Okay, so you can see that it is generating that specific test. So I showed you what that looks like at a basic level when it comes to building test workflows, but you can also now use Postbot to generate some of these tests. Some of my favorite ways to use Postbot is to visualize some of a response. So for example, if I wanted to visualize this response as a table, you can see that Postbot is generating a table for me. So it is using some CSS to generate a table based on title and author and genre, and I'm using the pm.visualizer.set to basically construct that visualizer payload.

12. Postbot and Schema Testing

Short description:

When using Postbot, you can easily visualize data in a table and add tests for schemas. Postbot simplifies schema testing and allows for validation based on available properties. It uses the TB4 library for schema validation, which is crucial for contract testing.

So ultimately, when I have my body, I can also visualize my data in a table as well. So this makes it a lot easier not only to take a look at the data I have available, but also to look at the visualization of that data that I might be interested in generating. So these are some ways to kind of take a look at Postbot. Postbot is a very interesting tool when it comes to testing, and it makes testing a lot easier for people. It provides even more of a template for people to get started. One way that I feel like is important, that Postbot is important is being able to like add a test for a schema. So like in this example, I'm using Postbot to test for a schema. So if I were to test for a schema as well, you can do a little bit more like schema type of testing where it is testing that your schema is specifically valid based on the various properties that you have available. And it's using like the TB4, you know, library to validate that schema. So this is also important when it comes to contract testing and aspects like that. So you can see that you have valid schemas as well.

13. Advanced Testing with Postman

Short description:

When it comes to advanced testing, there are various types of testing that you can do with Postman, such as contract testing, integration testing, mock data generation, performance testing, and regression testing.

When it comes to advanced testing, you know, there are a lot of things like contract testing, where you're, you know, testing for valid query parameters, testing for various arguments, checking for valid forms. And these are all, as you remember, all collections that we have, you know, got from our API collection template. So also when it comes to integration testing, like for example, if you have one API that is doing some sort of register, and then you have another API that is doing something else, and it's, you know, getting the token, then how do you integrate some of these APIs together and build some sort of integration test. So those are all very important in terms of the various different types of testing that you can do with Postman.

14. Advanced Testing and Resources

Short description:

You can do mock data generation, performance testing, regression testing, and contract testing with Postman. Postman supports various protocols like WebSockets, GraphQL, gRPC, and MQTT. Additionally, Postman provides scripts and snippets for testing and automation. Check out Postman Intergalactic for educational trainings and explore the Postman blogs for the latest updates. Postbot is a tool that helps with testing and API documentation.

You can do mock data generation where you can generate some mock data. You can also do some performance testing as well that allows you to, you know, test for specific loads. And so since I'm working on the web UI, performance testing is available on the Postman client. So and then of course, you have like regression testing, which you know, you can vary, build those workflows and test some of these like verifications. So when it comes to testing, there's a lot of testing that can be done within Postman.

So performance testing enables you to simulate traffic, and you can simulate how your API behaves under loads. And, you know, of course, contract testing is testing schemas and contracts. And so there's a lot more that we can do in terms of testing with APIs. And so just going back to my original workspace, so for the workshop, not only does Postman, for example, I tried to show you contract testing example here, and then working with like collection workspaces, and then using mock servers to mock requests. And I showed you a little bit more about automation as well. I wanted to share as well that there are a lot more other protocols that Postman supports, such as WebSockets, GraphQL, gRPC, and MQTT. So when it comes to working with APIs, there are not only does Postman support REST APIs, but it supports other APIs and other forms of APIs that you can get started at SWIT. So like for example, if we were to look at a GraphQL API, you can use the GraphQL API to query some data. Along with that, we also have scripts and snippets. So we have some scripts to test before the query is sent, and then some snippets to test after the query is sent. Similarly with gRPC, we also have some scripting capabilities here as well. So there's a lot that you can get started with.

I wanted to share a couple of resources. So for example, our first resource if you wanted to take a screenshot or take a look at this link is for our Postman Intergalactic. So Postman Intergalactic is a series of educational trainings. So we just had a training about API testing beyond the basics, AI and automation techniques. We've also have some training for our VS Code extension, testing and developing gRPC APIs, GraphQL APIs, intro to security. So there's a lot of content that is available on demand and is also available when we do it live. It's our live workshops and workspace. So we are always encouraging others to take a look at Postman Intergalactic, which is a great resource for folks. Then we also wanted to share all of our Postman blogs, which is a place for you to take a look and learn about some of the newest things that are coming out of Postman. So for example, we have some blogs about how Postmanauts use Postman and how workspace squads use Postman. There's some blogs specifically about Postbot that I wanted to share, which Postbot is a tool that not only helps you test, but also writes documentation. So you can use Postbot to document your APIs. So when it comes to, for example, Postman, you have your main documentation for your workspace, but you also have documentation for each of your APIs here.

15. Working with Postbot and Testing

Short description:

You can use Postbot to generate documentation and work with interesting examples like using the Spotify API to build playlists. We also have workspaces, a skills level, and a 15-day testing challenge to help you improve your Postman skills. Check out the Postman learning site, blogs, and Postman Academy for more resources. Thank you for joining the session, and feel free to connect with me on Twitter at PujaMakes. Happy holidays!

So you can use Postbot to generate some of this documentation as well to document all of your query parameter outputs, et cetera. So that's another useful thing. And then we have a lot more interesting examples of working with Postbot and testing. So for example, we have a colleague that used the Spotify API in Postbot to build an entire track result playlist and visualize maybe their Spotify, what Spotify comes out with every year, their stream, their most popular played songs, et cetera. So there's a lot of interesting ways to work with Postman aside from testing, but testing is obviously such a big aspect of Postman in itself.

We also have a couple of workspaces that kind of show you the different ways of writing tests. And then we have a skills level that allows you to get a deeper insight into your own skills with Postman, for example, what kind of experience you might have. And then we have the 15 days of Postman testing challenge, which goes through a lot of the things I've talked about today, understanding the API client, understanding version control, understanding how to debug, work with authorization, variables and scripts, API tests. So we have this entire 15-day challenge for testers that I encourage all to share.

So with that, I have shared quite a few different things, the learning, the community center, which is the Postman learning site, where you can get the documentation, Postman blogs. And then we also have the Postman Academy, which is here to help you level up your Postman skills as well. I hope this gives you a deeper insight into how you can go and work with Postman. I hope you were able to get a little bit of a deeper insight into the basics of testing, building workflows, working with collections, working with collection variables, and you're able to use that insight to go forward with your API testing practices. So with that, I'd like to say thank you for allowing me to share some insights with you all. And if you are interested in connecting with me, I am available at PujaMakes on Twitter and X. And I'm happy to help answer any questions or provide any deeper insights into the world of Postman. So with that, I'd like to end the stream and wish everyone some happy holidays as well. So hope everyone has a great rest of the year. And I look forward to connecting.

Watch more workshops on topic

React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Featured Workshop
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn
TestJS Summit 2022TestJS Summit 2022
146 min
How to Start With Cypress
Featured WorkshopFree
The web has evolved. Finally, testing has also. Cypress is a modern testing tool that answers the testing needs of modern web applications. It has been gaining a lot of traction in the last couple of years, gaining worldwide popularity. If you have been waiting to learn Cypress, wait no more! Filip Hric will guide you through the first steps on how to start using Cypress and set up a project on your own. The good news is, learning Cypress is incredibly easy. You'll write your first test in no time, and then you'll discover how to write a full end-to-end test for a modern web application. You'll learn the core concepts like retry-ability. Discover how to work and interact with your application and learn how to combine API and UI tests. Throughout this whole workshop, we will write code and do practical exercises. You will leave with a hands-on experience that you can translate to your own project.
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
TestJS Summit - January, 2021TestJS Summit - January, 2021
173 min
Testing Web Applications Using Cypress
This workshop will teach you the basics of writing useful end-to-end tests using Cypress Test Runner.
We will cover writing tests, covering every application feature, structuring tests, intercepting network requests, and setting up the backend data.
Anyone who knows JavaScript programming language and has NPM installed would be able to follow along.
TestJS Summit 2023TestJS Summit 2023
148 min
Best Practices for Writing and Debugging Cypress Tests
You probably know the story. You’ve created a couple of tests, and since you are using Cypress, you’ve done this pretty quickly. Seems like nothing is stopping you, but then – failed test. It wasn’t the app, wasn’t an error, the test was… flaky? Well yes. Test design is important no matter what tool you will use, Cypress included. The good news is that Cypress has a couple of tools behind its belt that can help you out. Join me on my workshop, where I’ll guide you away from the valley of anti-patterns into the fields of evergreen, stable tests. We’ll talk about common mistakes when writing your test as well as debug and unveil underlying problems. All with the goal of avoiding flakiness, and designing stable test.
TestJS Summit 2023TestJS Summit 2023
89 min
Building out a meaningful test suite that's not all E2E
We're all taught to follow the Testing Pyramid but the reality is that we build out the Testing Christmas Tree. In this workshop, David will talk you through how to break down projects and put the tests where they need to be. By the end of the workshop you will be able to update your projects so that anyone and everyone can start contributing and truly living up to "Quality is everyone job".
He will walk you through:- Component Testing- API Testing- Visual Regression Testing- A11Y testing
He will also talk you through how to get these all setup in your CI/CD pipeline so that you can get shorter and faster feedback loops.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

TestJS Summit 2021TestJS Summit 2021
33 min
Network Requests with Cypress
Top Content
Whether you're testing your UI or API, Cypress gives you all the tools needed to work with and manage network requests. This intermediate-level task demonstrates how to use the cy.request and cy.intercept commands to execute, spy on, and stub network requests while testing your application in the browser. Learn how the commands work as well as use cases for each, including best practices for testing and mocking your network requests.
TestJS Summit 2021TestJS Summit 2021
38 min
Testing Pyramid Makes Little Sense, What We Can Use Instead
Top Content
Featured Video
The testing pyramid - the canonical shape of tests that defined what types of tests we need to write to make sure the app works - is ... obsolete. In this presentation, Roman Sandler and Gleb Bahmutov argue what the testing shape works better for today's web applications.
TestJS Summit 2022TestJS Summit 2022
27 min
Full-Circle Testing With Cypress
Top Content
Cypress has taken the world by storm by brining an easy to use tool for end to end testing. It’s capabilities have proven to be be useful for creating stable tests for frontend applications. But end to end testing is just a small part of testing efforts. What about your API? What about your components? Well, in my talk I would like to show you how we can start with end-to-end tests, go deeper with component testing and then move up to testing our API, circ
TestJS Summit 2021TestJS Summit 2021
31 min
Test Effective Development
Top Content
Developers want to sleep tight knowing they didn't break production. Companies want to be efficient in order to meet their customer needs faster and to gain competitive advantage sooner. We ALL want to be cost effective... or shall I say... TEST EFFECTIVE!But how do we do that?Are the "unit" and "integration" terminology serves us right?Or is it time for a change? When should we use either strategy to maximize our "test effectiveness"?In this talk I'll show you a brand new way to think about cost effective testing with new strategies and new testing terms!It’s time to go DEEPER!
TestJS Summit 2023TestJS Summit 2023
21 min
Everyone Can Easily Write Tests
Let’s take a look at how Playwright can help you get your end to end tests written with tools like Codegen that generate tests on user interaction. Let’s explore UI mode for a better developer experience and then go over some tips to make sure you don’t have flakey tests. Then let’s talk about how to get your tests up and running on CI, debugging on CI and scaling using shards.