Can I take the values from one scenario and pass it to the Performance Scenario and execute all data-sets paralelly using Karate-Gatling

Viewed 129

I have implemented Karate for Functional Regression API Tests and Karate-Gatling for Performance tests with static data and it works great. Now there is a requirement where in I have to use multiple data set from one earlier scenario and pass this data set to Performance scenarios and then execute all the data-sets parallelly. My Base scenario which will generate the data will be -

Scenario: Get the list of Product ID
     Given url url
     When method GET
     Then status 200
     * def productids = $[*].productID

Each request will contain around 5 Product ID's and this will be used again to perform a GET in Product scenario as shown below

Scenario: Product Scenario
    Given url baseUrl + productids
    When method GET
    Then status 200

Now the requirement is to run Performance Tests for Product Scenario for all the product ID's obtained from the 1st scenario parallelly. i.e.: 10 threads of productID1, 10 threads of productID2, 10 threads of productID3 all of them should be triggered parallelly

Is this possible to implement via Karate-Gatling ?

Thanks

2 Answers

I also had the same requirement, but it doesn't really allow sharing the data between scenarios easily.

The workaround I did was -

  1. Create a lightweight spring boot REST+JPA app which runs on localhost and expose POST and GET methods for the data I need.
  2. At the end of the 1st scenario, post the data I need into the this app in .silent POST requests.
  3. At the start of the 2nd scenario, read the data from the app using GET method (again in .silent mode)
Related