Conditional Name Mapping combining a Project Variable & constant?
In my automation script, I have a NameMapping for a dropdown list of options on a webpage (which has identified each item in the list as a button).
The list is not constant and will change with each environment I want to test on.
I have a Project Variable, let's call it Default_Dept which is set to a department code e.g. ZZZ and the dropdown list contains the list of Department codes with the name of the Department in brackets e.g. ZZZ (My Department Name)
In order to select the correct 'button' (which is the ObjectType it has identified for each item in the list), I was trying to use contentText to identify which item in the list to select.
Ideally i'd like to do a conditional mapping: contentText Equals (Project Variable, Default_Dept) (*)
(as I don't really care about the Department name itself, i just want it to select the right department code from the list), but I can't find a way to combine a Project Variable with a wildcard 'constant'.
If I change the NameMapping to "ZZZ (My Department Name)" it finds the object no problem and selects the correct one, but other than creating another Project Variable that contains the code and name, in exactly that format of "CODE (NAME)" as it appears in the list, and then manually change the Project Variable each time the automation is executed in a new environment, as well as Project.Variables.Default_Dept code, then I can't think of another way around it?