Conditional WorkFlow in Postman : API Testing using Postman

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 24

  • @bflat32
    @bflat32 4 роки тому

    Hi, is it possible to run an if statement in the Body of postman? If name != null use it...

  • @Jayakrishna-ly3ei
    @Jayakrishna-ly3ei 3 роки тому

    what to write in tests, in java script or something else ? I cant find the video where you have told about the syntax on how to write (pm. ), how to write in that syntax and how to validate the id first name last name etc by writing in this way. Please share the links......

    • @TheTestingAcademy
      @TheTestingAcademy  3 роки тому

      Check the latest Postman Advance video, i have explained pm object thoroughly

  • @sohanonline1
    @sohanonline1 3 роки тому

    Hi. I have a question. I have 2 post requests. Now, i have written pre request script and test such that 1st post request will execute one time and it will go to 2nd post request. When 2nd post request execute, it will again go to 1st request. After 5 iterations, 2nd post request should stop the test. Now my concern is that i am not able to stop the script after 5th iteration. Can you give one example for this? i have used if and else condition. I dont know where to put next request as null

  • @neerajyadav-wt4cn
    @neerajyadav-wt4cn 4 роки тому

    i need this code..flow i understand but not able to seen the code,plz reply as soon as possible

  • @bhangra20001
    @bhangra20001 4 роки тому

    Great video, I have a questions. I am using the csv file and suppose I have 10 rows but one row might have null and I want to skip it and move to the next row. how can approach that. I have tried something like this but it didn't work
    var resourcetype = pm.iterationData.get("resource_type")
    if(resourcetype === null) {
    postman.setNextRequest(null); }

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

    Hi I need for clarity on this topic with more example

  • @lilikovale4821
    @lilikovale4821 5 років тому

    Awesome job! Very well explained.

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

    Very helpful. Thank You!!

  • @storytime6174
    @storytime6174 4 роки тому

    Sir i have a question i have 10 parameters and in first test script i write for positive scenario in which all the parameter will run and register successfully
    After that 9 more test cases in which one parameter is null respectively ...but in pre request script has more no of lines ...i have use switch case in test script

    • @storytime6174
      @storytime6174 4 роки тому

      Plz rply sir its urgent

    • @storytime6174
      @storytime6174 4 роки тому

      let swicthCaseIteration= +pm.environment.get("swicthCaseIteration");
      switch(swicthCaseIteration) {
      case 0:
      pm.environment.set("userMobileNumber", +pm.environment.get("userMobileNumber")+1);
      pm.environment.set("i", +pm.environment.get("i")+1);
      //pm.environment.set("userName", +pm.environment.get("userName")+1);
      pm.variables.set("addressOne", "delhi");
      pm.variables.set("addressTwo", "varansi");
      pm.variables.set("cityCode", "IN-BR-DH");
      pm.variables.set("countryCode", "IN");
      pm.variables.set("domainId", 75);
      pm.variables.set("emailId", "emailId3{{i}}@gmail.com");
      pm.variables.set("firstName", "automate");
      pm.variables.set("lastName", "string");
      pm.variables.set("mobileCode", "+91");
      pm.variables.set("mobileNumber","{{userMobileNumber}}");
      pm.variables.set("orgId", 170);
      pm.variables.set("roleId", 4);
      pm.variables.set("stateCode", "IN-BR");
      pm.variables.set("userName", "automation98{{i}}");
      pm.variables.set("zipCode", "656689");break;
      case 1:
      pm.variables.set("addressOne", "");
      pm.variables.set("addressTwo", "varansi");
      pm.variables.set("cityCode", "IN-BR-DH");
      pm.variables.set("countryCode", "IN");
      pm.variables.set("domainId", 75);
      pm.variables.set("emailId", "emailId3Negativee{{i}}@gmail.com");
      pm.variables.set("firstName", "automate");
      pm.variables.set("lastName", "string");
      pm.variables.set("mobileCode", "+91");
      pm.variables.set("mobileNumber","5678907898");
      pm.variables.set("orgId", 170);
      pm.variables.set("roleId", 4);
      pm.variables.set("stateCode", "IN-BR");
      pm.variables.set("userName", "automation98Negativee{{i}}");
      pm.variables.set("zipCode", "656689");break;
      case 2:

    • @storytime6174
      @storytime6174 4 роки тому

      I have wrriten like this more 10 cases in pre request and it is of 300 lines how can i reduce this

    • @TheTestingAcademy
      @TheTestingAcademy  4 роки тому

      Create a Javascript object and set in values in Switch (rather all values in env)

    • @storytime6174
      @storytime6174 4 роки тому

      @@TheTestingAcademy sir i have created object for positive test cases

  • @neerajyadav-wt4cn
    @neerajyadav-wt4cn 4 роки тому

    Hi, Parmod its very good.thanks.font is very low plz increase so that we easly seen.

  • @nayangawande1189
    @nayangawande1189 4 роки тому

    easily understandable, thanks :)

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

    Sorry to say but really didn't understand at all what was really explained. Please be very slow

  • @NikolayObraztsov
    @NikolayObraztsov 4 роки тому

    intro so flashy, give me shaking, dis.