Questions tagged [scala-gatling]

426 questions
1
vote
1 answer

scala - Gatling - I can't seem to use Session Variables stored from a request in a subsequent Request

The code: package simulations import io.gatling.core.Predef._ import io.gatling.http.Predef._ class StarWarsBasicExample extends Simulation { // 1 Http Conf val httpConf = http.baseUrl("https://swapi.dev/api/films/") // 2 Scenario…
1
vote
1 answer

Gatling: Concurrent execution within a scenario

I am trying to test the loading time of a home page. The sequence of HTTP requests made by browser when loading the home page is like A -> B -> [C, D, E] Which is to say B executes after A's response is received and C, D, E starts concurrently…
John Subas
  • 81
  • 1
  • 11
1
vote
1 answer

How to pass and get attributes in Gatling session from and to "exec" blocks

I'm pretty new at Scala/Gatling so forgive me if you see an anti-pattern or something wrong, I have a Gatling scenario in which I have to run some bash external scripts, and have to save some variables for their use in another exec block (I've tried…
1
vote
1 answer

Unable to read csv file from the build folder , that get created while I run my post requests

I am trying to read data from csv file for my patch and delete requests. I am not adding a csv file by myself, it is getting generated after the completion of my post requests in the build folder with the path resources/test/data/"****".csv…
1
vote
1 answer

How to setup Gatling to use client certificates per virtual user?

How to setup Gatling to use client certificates per virtual user? I am preparing Gatling simulations for API that is protected by client certificates and currently I only managed to set using one client certificate for all simulations in Gatling…
Pylyp Lebediev
  • 1,991
  • 4
  • 26
  • 44
1
vote
0 answers

How can we send multiple request from same user in gatling?

So I had a scenario in which I have to request two different endpoints at the same time from a user for the performance test. How can this be achieved using Gatling?
Ninja
  • 433
  • 3
  • 10
1
vote
1 answer

Gatling request is not getting executed

val makeReport = feed(randomNumberFeeder) .exec( session => { http("post_report") .post("/api/path/reports") .body(StringBody(JsonFactory.report(id = 1, number=…
blue_man
  • 43
  • 8
1
vote
1 answer

Gatling overrides `Cookie` header with the `Set-Cookie` header of previous response

I have an http request in Gatling that gets executed 10 times: val scnProxy = scenario("Access proxy") .exec(session => session.set("connect.sid", sessionId)) .repeat(10) { exec( http("Access endpoint") .get("/my-api") …
Gasim
  • 7,615
  • 14
  • 64
  • 131
1
vote
1 answer

Error: Could not find or load main class io.gatling.app.Gatling

Getting Error: Could not find or load main class io.gatling.app.Gatling while running a jar for performance test,but works fine when I run the same code on intellij Below are the Sample steps for the execution of code Step:1 Created a mvn package of…
Gani
  • 422
  • 1
  • 8
  • 16
1
vote
1 answer

Iterating through an array in Scala

I'm new to Scala, and trying to write few scripts for Load testing using Gatling. I'm trying to define a re-usable method to send the load, hence I created below method: def startLoad(scenario: Array[ScenarioBuilder]) = { setUp( …
CMM
  • 543
  • 4
  • 16
1
vote
1 answer

Unique Ids in each Gatling request

def getrandomNo(): String = { return ((rnd.nextDouble() * (1000000.0)).toLong).toString } scenario("scn getart).during(test_duration minutes) { exec(actionBuilder = http("req getart") .post(apiurl) .header("txn-id",…
aruma
  • 123
  • 12
1
vote
1 answer

Running a simulation file in Gatling in Mac

I'm a a novice with Gatling. I'm running my 1st test on Mac I've open the recorder in one terminal I've created a .har file I've opened user-file in another in another terminal. I'm trying to run subl RecordedSimulation.scala I'm getting an…
fypnlp
  • 1,372
  • 4
  • 18
  • 41
1
vote
2 answers

Validate JSON in Gatling performance test

I just wonder if I can validate a value of certain filed in JSON response using Gatling? currently the code only check if a field presents in the JSON response as following: val searchTransaction: ChainBuilder = exec(http("search Transactions") …
Huibin Zhang
  • 1,072
  • 1
  • 15
  • 30
1
vote
1 answer

Gatling: How to change saved integer value

Gatling: How to change saved integer value I save number of getting elements as integer value. val getElements = exec(http("1. get_elements") .get("/apis/;version=0/elements/items?") …
Lellya
  • 13
  • 3
1
vote
1 answer

Gatling foreach loop with doIf condition

I have a chain of ChainBuilder objects to execute. In one of them, I'm getting an "id". Then I'm getting a list of tasks and trying to loop through them to find the one I need to complete. But when I'm doing it like that, it says Type mismatch…
ottercoder
  • 852
  • 1
  • 12
  • 31