alinabond
2 years agoOccasional Contributor
Smart Assertion: Equals (One of)
Hello,
wenn I want to use an array in the smartAssertion which I have extracted with the Property transfer, it does not recognize an array.
E.g. I pass [EXT, GTF, SHZ, BHU] as an array and if I get EXT or BHU which are the first and the last elements of the array, it says it does not match.
I can't write the values with commas and without brackets, sice I'm extracting data via property transfer and it returns an array.
Thanks!
if I understand correctly, you need to transform the list (or a string containing brackets) into a string of comma-separated values.
If your source is an array, you can do a transformation with the join method:
list = ["A", "B", "C"]
log.info(list)
log.info(list.join(","))If your source is a string containing brackets, you can use the replaceAll method:
stringList = "[D,E,F]"
log.info(stringList)
log.info(stringList.replaceAll(/\[|\]/, ""))