You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value being passed for source while calling data function handler in actual test is A,B this combined value is needed for source however currently it is splitting it between 2 different parameters and hence value for source is appearing as only A
Can someone help in clarifying if is there any way to tackle this issue?
The text was updated successfully, but these errors were encountered:
@gourighode DataFunctions processor by default uses "," as a delimiter. To my knowledge, it's not that common to have "," in a key.
With the above limitation, you will have to choose a different delimiter (ex: |, _, etc) in the source key while sending parameters to the Data Function and replace it in the Data function handler as a workaround.
const source = ctx.args[0].replace("|",",");
And data function invocation $F{SamplePayload:A|B,....rest of params}
@leelaprasadv Even when we are passing array of values from DataFunctionHandler call it's splitting array values with "," delimiter. As long as I understand array with comma separated values will be common scenario to be passed from datafunction handler
Yes, as mentioned earlier - due to the limitation we have currently even arrays will not work. You will have to temporarily convert them into a delimited string (other than ",") before passing it to the function
Discussed in #336
Originally posted by gourighode April 3, 2024
We are using DataFunctionHandler concept to prepare request body with dynamic values for some keys.
In some of the scenarios value of specific key is comma separated
Example of Sample handler
handler.addDataFuncHandler(’SamplePayLoad', (ctx) => {
const source = ctx.args[0];
console.log("*********************",source)
const basePayload = {
source: ctx.args[4],
};
return basePayload;
});
Value being passed for source while calling data function handler in actual test is A,B this combined value is needed for source however currently it is splitting it between 2 different parameters and hence value for source is appearing as only A
Can someone help in clarifying if is there any way to tackle this issue?
The text was updated successfully, but these errors were encountered: