Forum Discussion

alinabond's avatar
alinabond
Occasional Contributor
2 years ago

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...
  • KarelHusa's avatar
    KarelHusa
    2 years ago

    alinabond

    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(/\[|\]/, ""))