Global variable that calls two other global variables?

Variable1: employee last name
Variable2: employee first name
Variable3: Variable 1 + comma + Variable2

I can’t seem to get this to work using multiple syntaxes: in paranthesis, with globalvariable.variablename. Maybe this simply isn’t an option?
If this helps, I’m trying to store these in the default profile option.

Thanks for the help!

Global variables can’t really “call” each other, they are not functions. They are meant to be static values. I guess can you provide an example of what you are trying to do? If Variable1 and Variable2 are always the same value (which they should be), why not just hard code it?:

Variable1 = Smith
Variable2 = John
Variable3 = Smith, John

Better yet, just do the concatenation in your script(s):

def lastFirst = GlobalVariables.Variable1 + ", " + GlobalVariables.Variable2

You might also reference this topic I posted a while back, which lets you set up your own set of “Global Variables” that are test suite-scoped:

I like this idea. However, I’m extremely new to programming and groovy so I’m building this strictly via manual mode. I’m assuming I have to put that statement in the script part? Does it need to go at the beginning? I’ll take a look at your linked post next. Thanks for the reply!

In this case, I would just define 3 global vars like I did above:

Variable1 = Smith
Variable2 = John
Variable3 = Smith, John