Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Karate - Possible to put scenario in a loop?

I want to know if it's possible to put scenario in a loop?
Imagine I have a scenario that I want to test it 10 times with 10 different data in a list. It's a good Idea to put whole scenario in a loop and even set scenario name in the loop. Is it possible?

like image 519
ehsan shirzadi Avatar asked Dec 05 '25 00:12

ehsan shirzadi


1 Answers

Yes, this is what Karate's data-driven call does. You need to split code into a second feature file (with only one scenario).

Here is the link to the documentation: Data Driven Features.

And in the karate demos look at the examples call-json-array.feature and call-table.feature.

like image 87
Peter Thomas Avatar answered Dec 08 '25 10:12

Peter Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!