Postman Beginner Tutorial 9 | Environments

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 67

  • @umairhussain1039
    @umairhussain1039 8 วันที่ผ่านมา

    I was using postman after a long time. Thanks for the quick refresher on environments. Appreciate it!

    • @RaghavPal
      @RaghavPal  8 วันที่ผ่านมา

      You're welcome! Glad it helped Umair

  • @Preelu
    @Preelu 8 หลายเดือนก่อน +1

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

    • @RaghavPal
      @RaghavPal  8 หลายเดือนก่อน

      Thanks Priya

  • @cosmincracana3611
    @cosmincracana3611 2 ปีที่แล้ว +9

    You are a great teacher!

  • @TechChefMM
    @TechChefMM ปีที่แล้ว +2

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

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Glad you liked it

  • @sumitsisodia5056
    @sumitsisodia5056 11 หลายเดือนก่อน +1

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

    • @RaghavPal
      @RaghavPal  11 หลายเดือนก่อน

      Most welcome Sumit

  • @adamtechnology3204
    @adamtechnology3204 8 หลายเดือนก่อน +1

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

    • @RaghavPal
      @RaghavPal  8 หลายเดือนก่อน

      Adam
      So happy to know this helped.. keep learning

  • @SP-vq7tg
    @SP-vq7tg 10 หลายเดือนก่อน +1

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

    • @RaghavPal
      @RaghavPal  10 หลายเดือนก่อน

      Most welcome SP

  • @arzoo-nandu
    @arzoo-nandu ปีที่แล้ว +1

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

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว +1

      Thanks a lot Arzoo

  • @JJJCyber
    @JJJCyber 2 หลายเดือนก่อน

    Excellent! Simple and Easy to understand.

    • @RaghavPal
      @RaghavPal  2 หลายเดือนก่อน

      Thanks a lot

  • @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.

  • @shahzaibidreesahmed4827
    @shahzaibidreesahmed4827 ปีที่แล้ว +1

    Great define. Thank you!

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Most welcome Shahzaib

  • @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

  • @gtbaba123
    @gtbaba123 9 หลายเดือนก่อน

    This can also be used for diff ports and tokens.

    • @RaghavPal
      @RaghavPal  9 หลายเดือนก่อน

      ok

  • @satyamjaiswal6885
    @satyamjaiswal6885 6 หลายเดือนก่อน

    Thankyou very much sir

    • @RaghavPal
      @RaghavPal  6 หลายเดือนก่อน

      Most welcome Satyam

  • @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

  • @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.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome

  • @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

  • @Pavithra-j1b
    @Pavithra-j1b 10 หลายเดือนก่อน

    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  10 หลายเดือนก่อน

      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

  • @princessazula8897
    @princessazula8897 2 ปีที่แล้ว

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

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      I will check on this

  • @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

  • @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

  • @srinavya7091
    @srinavya7091 3 วันที่ผ่านมา

    i am not able to understand why the password change was successful and not the email change

    • @RaghavPal
      @RaghavPal  3 วันที่ผ่านมา

      Navya
      need details, pls explain what and where exactly

    • @srinavya7091
      @srinavya7091 3 วันที่ผ่านมา

      Why you changed the environment to REG and changed the current value of email it showed an error whereas when we changed the password value to sword it worked why the error when email was changed?

    • @RaghavPal
      @RaghavPal  3 วันที่ผ่านมา +1

      okay i just did to show a demo how values will change with env.. in case its not working exactly for you.. do not worry.. these are dummy demo apis and may behave differently.. its fine as long as you got the concept