Question
params keyword
I am trying to implement a method that has params (C#'s version of Java's varargs) keyword (which, I believe, works like the Concat method in stringUtils), so I can add an unlimited number of strings to a method as input parameters. Take this as an example:
public string ShowParamsExample(params string[] sample){ return sample[0];}
PRS validates it, but when I debug it, it says that the "sample" object has not been instantiated. I also observed that the exception says (in this case):
Object has not been instantiated [some exception messages] on method ShowParamsExample(String[] sample) [line number], etc.
So, my question is, is "params" supported in PRS?
Apparently params does not work from a script. I am getting the same result as you are. This looks to be a limitation of the way a script is used in automation code. I have used params successfully from a c# component however. What is your use case? If you are trying to do string concatenation, the StringUtils.Format method now has a method that allows you to add additional params.