Postman Beginner Tutorial 9 | Environments

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • All FREE courses - automationstepbystep.com/
    After watching take this QUIZ - forms.gle/zsW3ivAZeFEx3xvX9
    What is Environment
    Why do we need Environments
    How to create Environment
    How to use Environment
    How to delete Environment
    Environment is a set of key-value pairs
    Step 1 - Create a api request
    Step 2 - Create environments and add key-value pairs (variables)
    Step 3 - Refer the variables in request
    Step 4 - Select the environment from dropdown and run request
    Step 5 - Create more environments and execute request
    #PostmanEnvironment
    ____________________________________________________________
    Stories by Raghav - automationstepbystep.com/stor...
    My Udemy Courses - automationstepbystep.com/udem...
    Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
    You can support my mission for education by sharing this knowledge and helping as many people as you can
    If my work has helped you, consider helping any animal near you, in any way you can.
    _______ ONLINE COURSES TO LEARN _______
    automationstepbystep.com/free...
    GitHub - github.com/Raghav-Pal/
    Udemy - www.udemy.com/user/raghav-pal-3/
    Training by Raghav at your venue - raghav.qna@gmail.com
    Training schedule - automationstepbystep.com/trai...
    ----------- UI TESTING -----------
    Selenium Beginners - bit.ly/2MGRS8K
    Selenium Java Framework from Scratch - bit.ly/2N9xvR6
    Selenium Python - bit.ly/2oyMp5x
    Selenium Tips - bit.ly/2owxc50
    Selenium Builder - bit.ly/2MKNtlq
    Katalon Studio - bit.ly/2wARFdi
    Robot Framework with RIDE- bit.ly/2Px6Ue9
    Robot Framework with Eclipse - bit.ly/2N8DZxb
    Protractor - bit.ly/2KtqVkU
    TestProject - bit.ly/2DRNJYE
    ----------- API TESTING -----------
    Web Services (API) - bit.ly/2MGafL7
    SoapUI - bit.ly/2MGahmd
    Postman - bit.ly/2wz8LrW
    General - bit.ly/2PYdwmV
    Katalon Studio API Testing - bit.ly/2BwuCTN
    ----------- MOBILE TESTING -----------
    Appium - bit.ly/2ZHFSGX
    Mobile Playlist - bit.ly/2PxpeUv
    ----------- CI | CD | DEVOPS -----------
    Jenkins Beginner - bit.ly/2MIn8EC
    Jenkins Tips & Trick - bit.ly/2LRt6xC
    Docker - bit.ly/2MInnzx
    Kubernetes - bit.ly/2MJIlMK
    ------------VIRTUALISATION------------
    Virtualization on windows - bit.ly/2SItIL9
    ----------- VERSION CONTROL SYSTEM -----------
    Git & GitHub - bit.ly/2Q1pagY
    GitLab - bit.ly/2kQPGyQ
    ----------- PERFORMANCE TESTING -----------
    JMeter Beginner - bit.ly/2oBbtIU
    JMeter Intermediate - bit.ly/2oziNVB
    JMeter Advanced - bit.ly/2Q22Y6a
    JMeter Tips & Tricks - bit.ly/2NOfWD2
    Performance Testing - bit.ly/2wEXbLS
    ----------- PROGRAMMING -----------
    Java Beginners - bit.ly/2PVUcXs
    Java Tips & Tricks - bit.ly/2CdcDnJ
    GROOVY - bit.ly/2FvWV5C
    JAVASCRIPT - bit.ly/2KJDZ8o
    PYTHON - bit.ly/2Z4iRye
    ----------- IDE -----------
    Visual Studio Code - bit.ly/2V15yvt
    ----------- BUILD TOOLS -----------
    Maven - bit.ly/2NJdDRS
    Gradle - bit.ly/30l3h1B
    ----------- OTHERS -----------
    Redis- bit.ly/2N9jyCG
    Misc - bit.ly/2Q2q5xQ
    Tools & Tips - bit.ly/2oBfwoR
    QnA Friday- bit.ly/2NgwGpw
    Sunday Special - bit.ly/2wB23BO
    Ask Raghav - bit.ly/2CoJGWf
    Interviews - bit.ly/2NIPPxk
    All Playlists - bit.ly/2LSiezA
    ---------- Connect with Raghav -----------
    Udemy Courses - www.udemy.com/user/raghav-pal-3/
    Twitter - / learnwithraghav
    TH-cam - / automationstepbystep
    Never Stop Learning
    Raghav

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

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

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

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

      Glad you liked it

  • @Preelu
    @Preelu 4 หลายเดือนก่อน +2

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

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

      Thanks Priya

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

    You are a great teacher!

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

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

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

      Most welcome Sumit

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

    Great define. Thank you!

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

      Most welcome Shahzaib

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

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

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

      Adam
      So happy to know this helped.. keep learning

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

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

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

      Thanks a lot Arzoo

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

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

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

      Most welcome SP

  • @arsalansaeed9404
    @arsalansaeed9404 5 หลายเดือนก่อน

    Amazing and simple thanks alot

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

      You are welcome 😊 Arsalan

  • @LongNguyen-cs1wc
    @LongNguyen-cs1wc ปีที่แล้ว

    thank you very much.

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

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

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

      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

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

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

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

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

      I will check on this

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

    Thankyou very much sir

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

      Most welcome Satyam

  • @C.Sakthivignesh
    @C.Sakthivignesh 11 หลายเดือนก่อน +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  11 หลายเดือนก่อน +1

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

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

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

  • @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 ปีที่แล้ว

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

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

    i will clear your videos in api post man

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

      Thanks for watching Kanaga

  • @gtbaba123
    @gtbaba123 4 หลายเดือนก่อน +1

    This can also be used for diff ports and tokens.

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

      ok

  • @KrzysztofChrzan
    @KrzysztofChrzan 3 หลายเดือนก่อน

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

    • @RaghavPal
      @RaghavPal  3 หลายเดือนก่อน +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

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

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

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

      You will need to check the persist option

  • @user-vp3ip6cp4p
    @user-vp3ip6cp4p 6 หลายเดือนก่อน

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

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

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

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

      Your videos very interesting sir

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

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

      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

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