AnsweredAssumed Answered

Modify argument values in request to send in LIVE SYSTEM/Image Validation mode?

Question asked by anpanday on Oct 8, 2015
Latest reply on Jan 23, 2017 by Aravind_CTS

Hello All,

 

We are trying to send an incoming request to LIVE system by changing couple of argument values. We have applied all solutions present on community but in vain. Below are the codes we are using currently. Any help is appreciated:

 

Code 1:

 

import com.itko.lisa.vse.stateful.model.Request;

import com.itko.util.ParameterList;

 

 

ParameterList args = lisa_vse_request.getArguments();

arg1 = args.getParameterValue("body_serviceOrder_orderLines_orderLine_service_characteristics_characteristic_values_value_5");

arg2 = args.getParameterValue("body_serviceOrder_orderLines_orderLine_service_characteristics_characteristic_values_value_4");

args.setParameterValue("body_serviceOrder_orderLines_orderLine_service_characteristics_characteristic_values_value_5", "epc3928");

args.setParameterValue("body_serviceOrder_orderLines_orderLine_service_characteristics_characteristic_values_value_4", "cisco");

testExec.setStateValue("arg1",arg1);

testExec.setStateValue("arg2",arg2);

lisa_vse_request.setArguments(args);

 

Code 2 (from community https://communities.ca.com/message/241828411#241828411):

 

import com.itko.lisa.vse.http.HTTPTransaction;

import com.itko.lisa.vse.http.Transaction;

HTTPTransaction transaction = ((HTTPTransaction) testExec.getStateObject("lisa.vse.http.current.transaction"));

 

//construct the logic to replace the username and password values as per your requirement

transaction.getRequestContentAsString().replace("eurodocsiscm", "cisco");

transaction.getRequestContentAsString().replace("Cable Modem", "epc3928");

 

 

testExec.setStateObject("lisa.vse.http.current.transaction",transaction);

return testExec.getStateValue("lisa.vse.http.current.transaction");

 

Our prime goal is to replace argument values with cisco and epc3928 and send this changed request to LIVE system.

 

With code 1, though we are able to change attribute values but the request sent to LIVE system is the same as incoming request which we find strange.

 

With code 2, it is not at all replacing the values.

 

Thanks,

 

Ankush

Outcomes