Q:

What's the lifecycle of the 'karate' object?

I need to call a .feature file from current feature file, and pass a variable from the called .feature file to the caller .feature file. I used karate.set() and karate.get(), but it seems the variable not passed this way.
In the called .feature file, I set the variable like "* def token = karate.get('xenpauth')".
And in the called .feature file, I try to get the variable like "* def xenptoken1 = karate.get('xenpauth') ". But the xenptoken1 is null.
Is the karate objected initialized before every scenario as the karate-config.js? 

A:

Yes, each Scenario is considered "independent" and "stand-alone".
Please read this Stack Overflow answer where this is explained in detail: https://stackoverflow.com/a/49312126/143475
Also read this section of the doc: https://github.com/intuit/karate#script-structure

