3

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

Anupama
  • 391
  • 4
  • 16

1 Answers1

2

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.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • 2
    Hi Peter, This is working perfectly fine. Just a suggestion, Why can't you start some End to End training sessions in you tube for beginners. Video tutorials for each topic in karate really helps many people who are using Karate . This is just a request from Karate fan :) – Anupama Oct 30 '18 at 09:00
  • 2
    @Anupama ok, I'll do this soon ! – Peter Thomas Oct 30 '18 at 09:01