Embedded expressions not replaced if surrounded by dot and underscores in it

Viewed 56

The embedded expressions are not replaced when appended, prepended or surrounded by characters in the following way

* def RADName = 'IntegrationFirstRAD'
* def tenantID = '1452119626'

* def out = 
        """
       {
    "nsName": "fld_<tenantID>_stage00.rad.<RADName>_.resources:<RADName>_resource"
       }
        """
* print out

Executing the scenario returns:

"nsName":"fld_1452119626_stage00.rad.<RADName>_.resources:<RADName>_resource

In the above scenario 'RADName' is not replaced with the value

1 Answers

Please use the replace keyword:

* def out = { nsName: 'fld_<tenantID>_stage00.rad.<RADName>_.resources:<RADName>_resource' }
* replace out.RADName = 'IntegrationFirstRAD'
* replace out.tenantID = '1452119626'
* match out == { "nsName": "fld_1452119626_stage00.rad.IntegrationFirstRAD_.resources:IntegrationFirstRAD_resource" }

You seem to be confused between embedded expressions and Scenario Outlines.

I guess it is worth saying this again, you really really really should read the documentation fully once.

Related