Postman Beginner Tutorial 9 | Environments

Поділитися
Вставка
  • Опубліковано 28 лис 2024

КОМЕНТАРІ • 61

  • @Preelu
    @Preelu 8 місяців тому +2

    Many many thanks! You are too generous with this tutorial series. Please keep up the good work 👍

  • @cosmincracana3611
    @cosmincracana3611 2 роки тому +9

    You are a great teacher!

  • @TechChefMM
    @TechChefMM Рік тому +2

    Excellent explanations and demos. Kudos Raghav! Thank you! MM

  • @sumitsisodia5056
    @sumitsisodia5056 10 місяців тому +1

    I am just watching your series of postman and you made it so simple for me to learn. Thanks alot 🙏🏻

    • @RaghavPal
      @RaghavPal  10 місяців тому

      Most welcome Sumit

  • @SP-vq7tg
    @SP-vq7tg 9 місяців тому +1

    Thankyou. This came out really handy to handle training session.

  • @JJJCyber
    @JJJCyber 2 місяці тому

    Excellent! Simple and Easy to understand.

  • @arzoo-nandu
    @arzoo-nandu Рік тому +1

    I have been through several🎉 videos it was one of the best

  • @adamtechnology3204
    @adamtechnology3204 7 місяців тому +1

    Thank you, 07:20 saved me so much time, I was looking everywhere what I missed it was just saving XD

    • @RaghavPal
      @RaghavPal  7 місяців тому

      Adam
      So happy to know this helped.. keep learning

  • @shahzaibidreesahmed4827
    @shahzaibidreesahmed4827 Рік тому +1

    Great define. Thank you!

  • @C.Sakthivignesh
    @C.Sakthivignesh Рік тому +1

    Thank you so much sir for made this video. Your way of teaching and communication skills are awesome.
    My question is in 10:36 this part of the video. You gave in currentvalue as Sword for password and in Initial value as pistol both are different.
    How it is successful and got status code as 200 sir can you tell ?

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Sakthi
      It works as it is a dummy API for testing, you can try too and check

    • @C.Sakthivignesh
      @C.Sakthivignesh Рік тому +1

      @@RaghavPal
      Ok sir. Thank you sir for your reply. I too tried it is working as you said because of dummy API.

  • @arsalansaeed9404
    @arsalansaeed9404 9 місяців тому

    Amazing and simple thanks alot

    • @RaghavPal
      @RaghavPal  9 місяців тому

      You are welcome 😊 Arsalan

  • @siphiworatsibe5609
    @siphiworatsibe5609 Рік тому

    Great Job, thanks, But how do you FORK or import and environment?

    • @RaghavPal
      @RaghavPal  Рік тому

      Siphiwo
      To fork or import an environment in Postman, follow these steps:
      *To fork an environment:*
      1. Go to the **Environments** tab.
      2. Click the **Fork** button next to the environment you want to fork.
      3. Enter a name for the forked environment and select a workspace to save it to.
      4. Click **Fork Environment**.
      The forked environment will be a copy of the original environment. You can then edit the forked environment as needed.
      *To import an environment:*
      1. Go to the **Environments** tab.
      2. Click the **Import** button.
      3. Select the environment file you want to import.
      4. Click **Import Environment**.
      The imported environment will be added to your Postman workspaces.
      *To use a forked or imported environment in a collection:*
      1. Open the collection you want to use the environment in.
      2. Click the **Environment** tab.
      3. Select the environment you want to use.
      4. Click **Update Environment**.
      The collection will now use the selected environment.
      Here is an example of how to fork an environment in Postman:
      ```
      1. Go to the **Environments** tab.
      2. Click the **Fork** button next to the **My Environment** environment.
      3. Enter a name for the forked environment, such as **My Environment Forked**.
      4. Select a workspace to save the forked environment to.
      5. Click **Fork Environment**.
      ```
      Once the forked environment has been created, you can edit it as needed.
      Here is an example of how to import an environment in Postman:
      ```
      1. Go to the **Environments** tab.
      2. Click the **Import** button.
      3. Select the environment file you want to import.
      4. Click **Import Environment**.
      ```
      Once the environment has been imported, you can use it in your collections.
      I hope this helps

  • @satyamjaiswal6885
    @satyamjaiswal6885 5 місяців тому

    Thankyou very much sir

    • @RaghavPal
      @RaghavPal  5 місяців тому

      Most welcome Satyam

  • @gtbaba123
    @gtbaba123 8 місяців тому +1

    This can also be used for diff ports and tokens.

  • @KrzysztofChrzan
    @KrzysztofChrzan 7 місяців тому

    Hi Sir. Is it possible to create environment by script in request pre-req section?

    • @RaghavPal
      @RaghavPal  7 місяців тому +1

      Krzysztof
      In Postman, you can use pre-request scripts to execute JavaScript before a request runs. By including code in the Pre-request Script tab for a request, collection, or folder, you can carry out pre-processing tasks such as setting variable values, parameters, headers, and body data
      To create a pre-request script, follow these steps:
      1. Open the Postman app and select the collection or request to which you want to add the script.
      2. Click the Code tab and then select the Pre-request Script tab.
      3. In the editor, paste the JavaScript code for your pre-request script.
      You can also add pre-request scripts to entire collections or folders within collections. In both cases, your pre-request script will run before every request in the collection or direct child request in the folder. This allows you to define commonly used pre-processing steps that you need to execute for multiple requests
      Feel free to explore more about pre-request scripting in Postman, and don't hesitate to ask if you have any further questions

  • @akanshasaraswat7274
    @akanshasaraswat7274 2 роки тому +3

    Hey,
    Please make a video for how to write test cases from Real company SRS.
    What to read.
    Pls if you make this so it will be more helpful for beginners who wants to write test cases from SRS.
    Pls pls

    • @RaghavPal
      @RaghavPal  2 роки тому

      I will do Akansha

    • @doris2988
      @doris2988 2 роки тому

      Can you do real automation and manual testing. It is easy to get when you explain. Thanks a lot for your perfect videos.

  • @LongNguyen-cs1wc
    @LongNguyen-cs1wc 2 роки тому

    thank you very much.

  • @mv8167
    @mv8167 Рік тому

    Thank you, I enjoy your teaching style/ For passwords/User Ids security, can we use any of the Secret Server tools?

    • @RaghavPal
      @RaghavPal  Рік тому

      Hi Mike, not sure of the tools you are referring to

    • @mv8167
      @mv8167 Рік тому +1

      No worries, I found Thycotic will work as my secret server host. However, executing tests on an Enterprise level causes a need to keep passwords secure. Today maintaining secure passwords is an afterthought. I am reviewing which secret server apps work best across multiple automation tools when executing the CICD with Jenkins and single tools like Selenium, Postman, etc.

    • @RaghavPal
      @RaghavPal  Рік тому

      Ok, in case I get any info on this will share

  • @Pavithra-j1b
    @Pavithra-j1b 9 місяців тому

    Under REG env, when the value for password was changed to sword, it worked. However, when the value of email was changed, it shows as error. Why so?

    • @RaghavPal
      @RaghavPal  9 місяців тому

      Pavithra
      Although details can help me, but don't worry too much if its related to API functioning as these are demo APIs

  • @vijay_segar1032
    @vijay_segar1032 2 роки тому

    while doing dupliate the environments, i get empty in current value... what should i do ?

    • @RaghavPal
      @RaghavPal  2 роки тому

      You will need to check the persist option

  • @Prince_Shahid
    @Prince_Shahid Рік тому

    I have a question
    I have a requirement where I should capture a field from the response and print it in console
    So am able to achieve that but
    When am trying to iterate it using csv file
    Am not able to print the response value got from all the iteration at one shot.
    Like a,b,c,d..
    How to achieve that?
    Please help

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Hi Prince
      Here are the steps on how to capture a field from the response and print it in console using Postman and a CSV file:
      1. Create a new Postman collection.
      2. Import the CSV file into the collection.
      3. Create a request for each row in the CSV file.
      4. In the request, add a variable for the `id` field in the CSV file.
      5. In the request, add a script that will capture the value of the `name` field from the response and print it to the console.
      6. Run the collection.
      The script that you can use to capture the value of the `name` field from the response and print it to the console is as follows:
      ```
      var id = pm.variables.get('id');
      var response = pm.response.json();
      var name = response['name'];
      console.log(name);
      ```
      This script will first get the value of the `id` variable from Postman. Then, it will get the value of the `name` field from the response. Finally, it will print the value of the `name` field to the console.
      If you want to print the response value got from all the iteration at one shot, you can use a loop to iterate through the rows in the CSV file and call the script for each row. The following code shows an example of how to do this:
      ```
      for (var i = 0; i < pm.iterationData.length; i++) {
      var id = pm.iterationData[i]['id'];
      var response = pm.response.json();
      var name = response['name'];
      console.log(name);
      }
      ```
      This code will iterate through the rows in the CSV file and call the script for each row. The script will then capture the value of the `name` field from the response and print it to the console.
      I hope this helps

    • @Prince_Shahid
      @Prince_Shahid Рік тому

      @@RaghavPal OMG.
      thanks your for your quick response..
      I will definitely try and let you know the results
      Thank you once again…🫡

    • @Prince_Shahid
      @Prince_Shahid Рік тому

      @@RaghavPal
      Hi Raghav,
      I think I have miss communicated my requirement
      Please find the step by step requirement below
      1. I have a collection with 2 Apis which has authentication and post request api
      2. Authentication api is taken care of using Env variable (token barrier)
      3. For Post Api request body am reading the required field values from csv data file
      4. Am giving the number for iteration in the iteration value filed in tool
      5. Am getting the response for every iteration with my expected data bht from the whole response body am looking for to print one value on to console for that I have written a script to fetch the value from the response.
      6. It’s working fine and am getting the value printed on console for every iteration
      Like
      Api call
      Response Value(a)
      Api call
      Response Value(b)
      Api call
      Response Value(c)
      .
      .
      Now i was trying to print Response Values from above calls in a row at one shot into console like
      (Values:- A,b,c..)
      and also can we export the same output values to output csv file (A,b,c…)?

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Here are the steps on how to print the response values from the Postman API test in a row at one shot into the console and export the same output values to an output CSV file:
      1. In your Postman collection, add a new request called `Print Response Values`. This request will be used to print the response values from the other requests in the collection.
      2. In the `Script` tab of the `Print Response Values` request, add the following code:
      ```
      const response = pm.response;
      const responseBody = response.json();
      const responseValue = responseBody.someValue;
      console.log(responseValue);
      ```
      This code will get the response value from the response body and print it to the console.
      3. In the `Iterations` field of the `Print Response Values` request, set the value to the number of iterations that you want to run.
      4. Run the collection. The `Print Response Values` request will be run for each iteration, and the response value will be printed to the console.
      5. To export the response values to an output CSV file, add a new request called `Export Response Values`. This request will be used to export the response values to a CSV file.
      6. In the `Script` tab of the `Export Response Values` request, add the following code:
      ```
      const response = pm.response;
      const responseBody = response.json();
      const responseValues = Object.keys(responseBody);
      const csvData = responseValues.join(',');
      pm.writeFile('output.csv', csvData);
      ```
      This code will get the response values from the response body, join them together with commas, and write them to a CSV file called `output.csv`.
      7. Run the collection. The `Export Response Values` request will be run once, and the response values will be exported to the CSV file.
      Here are some additional things to keep in mind:
      * The `Print Response Values` request can be used to print any value from the response body. You can change the code in the `Script` tab to print any value that you want.
      * The `Export Response Values` request can be used to export any data from the response body to a CSV file. You can change the code in the `Script` tab to export any data that you want.
      * You can also use the `Run In Parallel` option in Postman to run multiple requests at the same time. This can be useful if you want to print the response values from multiple requests at once.
      I hope this helps

    • @Prince_Shahid
      @Prince_Shahid Рік тому

      @@RaghavPal thanks you so much..
      It helped me

  • @ryanaditya3680
    @ryanaditya3680 Рік тому

    Hii sir, Im coming here for the first time to learn postmanAPI.
    but im just a little bit confused When you changed the password and sent it on env REG it clearly passed but why did when you changed your email and then pressed send get an error?
    and what that means for the Error message?

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Ryan
      The error message you are getting is:
      ```
      Error: 400 Bad Request
      Content-Type: application/json
      {
      "message": "The email address you provided is already in use.",
      "errors": [
      {
      "resource": "users",
      "field": "email",
      "code": "email_already_in_use"
      }
      ]
      }
      ```
      This error means that the email address you provided is already in use by another user. You will need to provide a different email address in order to register.
      The reason why the password change request was successful but the email change request failed is because the password change request does not check if the email address is already in use. The email change request, on the other hand, does check if the email address is already in use.
      I hope this helps

  • @princessazula8897
    @princessazula8897 2 роки тому

    Hi sir, can you do a video with handling cookies with the interceptor or/and the proxy ? Thanks a lot :)

  • @ravireddy7155
    @ravireddy7155 2 роки тому

    When it will. Complete this series sir

    • @RaghavPal
      @RaghavPal  2 роки тому +1

      About 4 videos left Ravi, I am trying to post 1 video everyday