Hi Community.
Need your help in figuring out a way to store both dynamic and static values in a variable.
Eg: I need to store value in a variable in this format:
{“$Downpay2”} + “Payment was reversed. Reason:” + RReason
Here Downpay2 is fetched from UI.
RReason is a static variable
Remaining is a text.
All the 3 needs to be combined and stored in a variable.
This variable then needs to be compared against Actual Text that comes in the UI.
1 Like
Please try to write a code yourself first, which will best describe your problem.
If you got any error, please ask for advice while sharing the full source code, error logs, screenshots, etc.
Unless you show your full source code, we can not give you any appropriate advice to you.
Hi @kazurayam ,
I am using code as seen in Screenshot and getting below errors:
The messages says you have a $()
somewhere, and it is wrong.
Where is it? Do you see? Have you tried to find it?

Possibly you want to change this to
= WebUI.concatenate([ "${Downpay2}" , 'P
Please find a pair of double quotes “…” are inserted.
If i run this with quotes,it is giving me the below results:
The Actual Downpay amount which is captured from UI isn’t getting stored in the string.
Further this Downpay amount value is $70.Do we need to change the Formatting.
Expected Activity2 should store value like:
$70 Payment was reversed. Reason: Signature Irregular.
Not this

but this
"${Downpay2}"
In Groovy language, single-quoted string and double-quoted string have different semantics. Please study this:
https://www.baeldung.com/groovy-strings
Thanks @kazurayam .
I figured out the solution.No quoted strings were required to display the expected output.