When JavaScript executes in Karate, the built-in karate object gives some commonly utilized utility features. And with Karate expressions, you may "dive into" JavaScript without having to outline a operate - and conditional logic is a good example. For ease, some stats are logged towards the console when execution completes, http://karate64063.widblog.com/19560121/getting-my-karate-to-work