Karate API: responseTime not passed to calling feature

Viewed 14

We are using a wrapper feature to do a bunch of logic and only have the API call in another feature.

  • A.feature: API call only
  • B.feature: get the cookie, build the payload, call A.feature passing cookie and payload, get the results data back.

def resp = call read('file:A.feature') arguments

I can get everything from the response of A.feature within B.feature by using resp.response., and I can get responseStatus by calling resp.responseStatus.

However, I cannot get the responseTime neither calling resp.responseTime or resp.response.responseTime.

Any idea what I'm doing wrong? I would think responseTime behaves the same as responseStatus

1 Answers

ok, found this one as well: I just needed to define a variable in A.feature as follow:

def time = responseTime

And then call that variable in B.feature from the result:

resp.time
Related