user14079473
user14079473

Reputation:

How to write multiple statements under if section in karate?

Like I have do to some steps if some condition comes true how can I write multiple steps in if statement?

* if(responseStatus == 200) call myfunction 

and after that I have to add one more statement under this "if" how will I add that?

Upvotes: 1

Views: 1179

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

a) use a JS function * if(responseStatus == 200) myFunction()

b) use eval

* eval
"""
if (condition) {
   // blah
   // blah
}
"""

For more ideas, read this please: https://stackoverflow.com/a/50350442/143475

Upvotes: 1

Related Questions