0

I'm trying to get a value of a variable inside an array to store it as a global variable for reuse on collection runner. The issue is this variable data is not exposed on any response data.

$scope.loadWorkAreasAndMenu = function (callback) {
             $('.modal-backdrop').hide();
             var workSpaceIdQs = GetParameterValues('WorkSpaceId');
             var workspaceId = null;
             if (workSpaceIdQs != undefined && workSpaceIdQs.trim().length != 0) {
                 workspaceId = workSpaceIdQs;
             }
             var jsonMenu = JSON.stringify({
                 slotToken: window.top.Token,
                 workspaceId: workspaceId,
                 viewPortType: currentViewport
             });

             var serviceData = {
                 serviceName: "GetWorkAreasAndMenu",
                 serviceInputs: LZString.compressToEncodedURIComponent(jsonMenu)
             };

             var config = {
                 headers: {
                     'Content-Type': "application/json"
                 }
             };

I need to capture the variable "serviceInputs" but the issue is it is not exposed in any the response data. How we could retrieve this value during runtime execution itself ?

  • Question is unclear! – Divyang Desai Sep 03 '19 at 09:28
  • This is my scenario. Once after i perform a login step using postman (POST method), i am getting response data with some values. But to proceed further with other scenarios i need a value for the variable key *serviceInputs*. But this is not available in any response data. The code i have provided about is the js file in the application which generates that Key *serviceInputs* as serviceData. So if i want to capture its value, how could i do it in postman? – Anand Sathiyaseelan Sep 03 '19 at 11:05
  • You need create api to get *serviceInputs* and then call that api from Pre-request script and save the response value to the environment variable. – Divyang Desai Sep 03 '19 at 11:20

0 Answers0