Smart Assertion: Equals (One of)
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would it be possible to show the screen short of Smart Assertion?
Have you tried with Exists in Condition field?
I am assuming that the tool still considers your input to Valid Value as String, but not an array.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rao,
sure. I pass a variable
and variable looks like this
BR
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just looking at the documentation
Do you want to try by removing square brackets?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rao,
yes, this would help, because it accepts values with comma and without brackets.
Do you know how?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure if I understand your question.
Did you try the above suggestion?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without brackets it works, but the problem is, that I extract the values and pass the variables automatically. I don't want to remove it manuelly coz it's has to be automated test.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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(/\[|\]/, ""))
https://apimate.eu
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, just found myself the last method you've mentioned with replaceAll 👍
