1
votes

I have got the response in the background to one of the request and passing to the function for polling purpose and need to run until specific condition met. In that function, I need to pass the values to the calling feature JSON file

  while (true) {
  var result = karate.call('extractProgress.feature') packageid; -- package id 

is response of another request

I followed the similar way as mentioned but in that not passing any parameter. https://github.com/intuit/karate/blob/933d3803987a736cc1a38893e7039c4b5e5132fc/karate-demo/src/test/java/demo/polling/polling.feature

But i am getting the below error

feature(com.intuit.karate.testng.KarateTestngTest): java.lang.RuntimeException: javascript evaluation failed: packageid, ReferenceError: "packageid" is not defined in at line number 1

2
@Peter Thomas I don't whether this request will come under your bucket or not.So adding you hereuser1980552
@PeterThomas done.I am new to stack overflow.user1980552
are you trying to pass the varaible packageid as an input to your feature file ? @user:1980552Babu Sekaran

2 Answers

1
votes

Input for call inside js should be given as

karate.call("<featureFile>",yourInputVaraible);

refer this on doc https://github.com/intuit/karate#the-karate-object

0
votes

It sounds wrong to me, maybe you have a typo.

Also please read the docs carefully. Only JSON is supported as a call argument.

The best way for you to get support is to follow this process, else no one can help you with the limited info you seem to be providing in your questions.

https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue