Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Configure your collection
  2. Perform any functions required to be performed on every single call as part of the collection

  3. Code Block
    languagejs
    themeMidnight
    firstline1
    titleCollection Configuration Script
    linenumberstrue
    //Demonstrate a function call to confirm that the rospnse is a 200 Response/ Successful response.
    pm.test("Status code is 200", function () {
        pm.response.to.have.status(200);
    });
    
    //All responseses are required to  be converted to JSON in Order to be read, and Passed through as values.
    //This is perfermed on an individual call level, but outputting this as a JSON Response in your developer tools will help identify the correct required variable
    var responseJson = xml2Json(responseBody);
    console.log(responseJson);

   

...

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@20f86d
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("api","web-service","chained-request") and type = "page" and space = "FLIP"
labelsapi web-service chained-request

...

hiddentrue

...


  1. Configure your Login Procedure and assign Variables required


    1. Code Block
      languagejs
      themeMidnight
      firstline1
      titleCollection Configuration Script
      linenumberstrue
      //In Order to refer to the JSON Response the Variable must be declared on a Local Request Level.
      var responseJson = xml2Json(responseBody);
      
      
      //Set a Global Variable for Session Information.
      //Variables can also be declared on a Environment & Collection level
          //pm.environment.set
          //pm.collection.set
      //pm.globals.set("variable_key", "variable_value")
      
              //variable_value == variable.path.element
              //variable == responseJson['s:Envelope']['s:Body']
              //path == LoginResponse.LoginResult
              //element == AccountID
      pm.globals.set("AccountID",responseJson['s:Envelope']['s:Body'].LoginResponse.LoginResult.AccountID); 
      pm.globals.set("DistributorID",responseJson['s:Envelope']['s:Body'].LoginResponse.LoginResult.DistributorID); 
      pm.globals.set("Expires",responseJson['s:Envelope']['s:Body'].LoginResponse.LoginResult.Expires); 
      pm.globals.set("Key",responseJson['s:Envelope']['s:Body'].LoginResponse.LoginResult.Key); 
      pm.globals.set("UserID",responseJson['s:Envelope']['s:Body'].LoginResponse.LoginResult.UserID);