静静子
静静子

Reputation: 29

Karate-Gatling: requests with random id are not getting aggregated even if I set the protocol

I am doing the demo for Karate Gatling to see if it meets our needs for performance tests, my test scenario is to create many transactions and check the transaction status, below are some of my requests:

Given url baseURL+ '/v2/transactions/'+referenceNo
Given url baseURL+ '/v2/transactions/'+referenceNo
Given url baseURL+ '/v2/transactions/'+referenceNo+ '/pay-way'

The referenceNo will be randomly generated, so I wrote the protocol to make them aggregated:

 val protocol = karateProtocol(
    "/transactions/{referenceNo}" -> Nil,
    "/{referenceNo}/pay-way" -> Nil
  )

But it doesn't work. In the report, all the requests are showing separately like this: enter image description here

Upvotes: 1

Views: 44

Answers (1)

LurkinGherkin
LurkinGherkin

Reputation: 356

You need to ensure that the paths in the protocol match the paths shown in the report. For example,

val protocol = karateProtocol(
"/api/v2/transactions/{referenceNo}" -> Nil,
"/api/v2/transactions/{referenceNo}/pay-way" -> Nil
) 

This change should aggregate the requests correctly in the report.

Upvotes: 1

Related Questions