Karate: [gatling] approach for feeders or equivalent

Created on 5 Oct 2018  路  5Comments  路  Source: intuit/karate

Refer this question on Stack Overflow: https://stackoverflow.com/q/52665865/143475

enhancement fixed

Most helpful comment

With the PR Add gatling session attributes as context args and the commit 0c98dc5 you can use feeders like this:

val myfeeder = Iterator.continually(Map("email" -> "some random email"))
feed(myfeeder).exec(PreDef.karateFeature(myfeature))

In your feature

Scenario: Print email from feeder
    * print __gatling.email

So you can access the current feeder value in the Session via __gatling. {feederKey}

All 5 comments

Currently every feature is using data from scenario outline examples, so every user is using exactly the same "records" from that table. It would be good that we could feed data into the scenario using gatling feeders. In such way every user could update per iteration the data that he's going to use. We'd prevent use the same values for all the users (for example we can avoid to insert the same value from two different users)

Gatling feeders work like this:

feed(myfeeder).exec()

so if we use karate and gatling we could have something like this:
feed(myfeeder).exec(PreDef.karateFeature(myfeature))

With the PR Add gatling session attributes as context args and the commit 0c98dc5 you can use feeders like this:

val myfeeder = Iterator.continually(Map("email" -> "some random email"))
feed(myfeeder).exec(PreDef.karateFeature(myfeature))

In your feature

Scenario: Print email from feeder
    * print __gatling.email

So you can access the current feeder value in the Session via __gatling. {feederKey}

Great solution

@leozilla awesome ! love the fact that you could get in and contribute to the gatling integration code.

0.9.0 released

Was this page helpful?
0 / 5 - 0 ratings