Questions tagged [gatling]

1

votes
1

answer
1.4k

Views

Gatling Feeder Issue : No attribute name 'CSVFieldName' is defined issue

I am newbie for Gatling and trying to read some fields from CSV and use them in my gatling scenario but facing No attribute name 'CSVFieldName' is defined issue ; some details: Gatling Version : bundle-2.2.3 CSV Name : memId.csv CSV contents : memid CKABC123 Scala File contents : //Class Decl...
Ritesh Sharma
1

votes
0

answer
6

Views

Karate-Gatling: One request is not recorded

One request of rampUsers() is not recorded. Eg. when I do a create.inject(rampUsers(10) during (5 seconds)).protocols(protocol) Simulation mock.CatsKarateSimulation started... ================================================================================ 2019-04-22 15:59:37...
Yu Xi Lim
1

votes
0

answer
743

Views

How to inject json coming from feeder inside body with gatling

I have a gatling scenario which create a Http object create a post request with a body set up the scenario I can inject a body from a json file containing this: [{'id':'1'}] At this point I have no problem. My question is on the second point. I want users to have theirs body feed with different id....
a.moussa
1

votes
2

answer
463

Views

How get access_token from body for use in another method

Good afternoon. Slightly confused in the Gatling documentation, I can not find a solution. I want to get a token to use in another method as a header. Here is an example of the first method where I get a token: exec( http('HTTP Request auth') .post('http://blabla:9001/connect/token') .header('Conten...
denchik_muh
1

votes
1

answer
380

Views

Custom assertion on Gatling

Is it possible to create a custom assert based on a boolean value? Something like this: setUp(scn.inject(rampUsers(7) over (1 minutes))).protocols(httpProtocol). assertions( assert(/*method that returns boolean value*/), /*other assertions*/ ) Thanks!
Matias Fornara
1

votes
1

answer
176

Views

Why does Gatling stop simulation when any scenario exists and doesn't wait until the end?

Let's say I have this configuration val scn = (name: String) => scenario(name) .forever() { .exec(request) } setUp( scn('scn1').inject(atOnceUsers(1)) .throttle( jumpToRps(1), holdFor(10 seconds) ), scn('scn2').inject(atOnceUsers(1)) .throttle(jumpToRps(1), holdFor(20 seconds)) ).protocols(http.base...
user219882
1

votes
0

answer
161

Views

Gatling and XPath problems

Using IntelliJ and a xml soap response, I get a xpath generated that is unique using IntelliJs built in functionality. Putting this into gatling scala script val scn = scenario('RuleEngineSimulation') .exec(http('request_0') .post('/EngasjementBasisA2A') .headers(headers_0) .body(RawFileBody('RuleEn...
Magnus Jensen
1

votes
1

answer
769

Views

Regex and / and " in Scala/Gatling

I have a html response and want to save a token (bid_kid) below Logg inn - here However the check I am running is appearing to be malformated in IntelliJ like this (adds two \): .check(regex('content=\\\'(?[0-9A-Z]*)\\\'').find.saveAs('token')) Do I need to 'wrap' the regex experssion in some mather...
Magnus Jensen
1

votes
1

answer
82

Views

gatling checking if soap response contains node

I use Gatling to test against an API responding with this: 01018448285 0005009147 J How can I script that the response must contain the element: ? I guess something in the lines of: .check(xpath('whathere').exists) But what should be stated as 'whathere'?
Magnus Jensen
1

votes
2

answer
427

Views

Gatling test CSRF Spring Security block my post via a web form

I want to do a Gatling Test and send a form via a Post with form params but i get a 403 because of a CSRF Token generated from spring Security this my Scenarii: val sentHeaders = Map( 'Content-Type' -> 'application/x-www-form-urlencoded', 'User-Agent' -> 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52...
AlexAlba
0

votes
0

answer
3

Views

JsonPath Path Not Found Exception While Data Driving From Jsonfile So As To Randomize the data

Is there a Issue to use below code,basically data driving from Jsonfile ,I am creating random numbers below that is eventidStart and eventidEnd are fetching their respective values from Json file which is shown below var idNumbers=(eventidStart to eventidEnd).iterator def eventidStart: Int = JsonP...
Tk infostrings
1

votes
1

answer
141

Views

Custom DSL by extending Gatling: How to Scala?

We're using Gatling to load test our application (and it works great). We're attempting to DRY up some of the code by making composable extensions on the Gatling classes (like ScenarioBuilder / ChainBuilder / etc. found in io.gatling.core.structure). Here is an example of one of our scenarios: val...
Levi
1

votes
0

answer
588

Views

Gatling checkIf syntax

A legacy app has the below working Gatling test private val getUserByTuid = scenario('GetActiveUserInfoWrapper') .feed(users.toArray.circular) .exec( http('GET /v1/foo/{id}') .get('/v1/foo/${id}') .header('Content-Type', 'application/json') .header('User-Agent', 'gatling') .check(status is 200) .che...
fred
1

votes
1

answer
189

Views

Run gatling project from an executable jar

I have a small Gatling project which I would like to package through sbt and then run on different Linux/Windows machines with different JVM parameters. I tried already the sbt package command but that didn't work out. Anyone has done something similar before?
user134
1

votes
1

answer
210

Views

@Karate Gatling is not generating report when i hit the endpoint once

My Gatling Simulation class, class extends Simulation { before { println('Simulation is about to start!') } val smapleTest = scenario('test').exec(karateFeature('classpath:demo/get-user.feature')) setUp( smapleTest.inject(rampUsers(1) over (10 seconds))).maxDuration(1 minutes) //).assertions(global...
Manoj Mishra
1

votes
1

answer
415

Views

@karate How to pass parameter to a feature file in gatling simulation class?

Let's consider a scenario, we have to run the performance test for 'create an account api' which takes input as header/path param 'Auth token' and input data like user account name . So for above scenario we have 2 feature file as, to run performance test for POST http://baseUrl/auth_param/create/i...
Manoj Mishra
1

votes
1

answer
30

Views

How do you add tags with Gatling?

I have just installed Gatling and am trying to run the quick start scenario. However, I do not see anywhere in the recorder a place to add tags. In fact, the word 'tag' appears nowhere on the recorder panel. I must be missing something really obvious. Any help would be appreciated.
Bruce M
1

votes
1

answer
400

Views

Gatling JSON Feeder Unique POST Bodies

I have a JSON file that contains a JSON Array test.json [ { 'Name': 'Bob' }, { 'Age': '37' }, { 'DOB': '12/01/1985'} ] I would like to test each respective element in the JSON array against an endpoint to observe the performance of the system against unique payloads currently I have testService.scal...
Bobshark
1

votes
0

answer
107

Views

Not able to run tests in docker/gatling in different folder path than /home/gatling

I'm trying to run tests in gatling in docker and everything works fine for the command: docker run -it --rm -v /c/CURRENTPATH/conf:/opt/gatling/conf -v /c/CURRENTPATH/user_files:/opt/gatling/user-files -v /c/CURRENTPATH/results:/opt/gatling/results -e JAVA_OPTS='-Ddebug=true' But when I change CURR...
Arqsz
1

votes
0

answer
117

Views

How to fetch random values from feeder for using in header in gatling

I have a CSV of 1000 tokens to be used in the header, any random token in each scenario. And that random token should remain the same for all get and post requests in the scenario. Below is the sample data of the CSV file. token Token token1tewq Token token2cbvj and so on till 1000 rows The scenario...
user2884776
1

votes
2

answer
358

Views

How to read a JSON file into a Map, using Scala

How can I read a JSON file into a Map, using Scala. I've been trying to accomplish this but the JSON I am reading is nested JSon and I have not found a way to easily extract the JSON into keys because of that. Scala seems to be wanting to also convert the nested JSON String into an object. Instead...
djangofan
1

votes
0

answer
87

Views

Gatling, Karate and classic feeders

How can I use classic gatling feeders in our karate features? I mean I don't want to feed all the users with the same data in Scenario Examples, and I'd like to use a feeder so that each user has a unique record. Is is possible to do?
Ignacio Degeneffe
1

votes
0

answer
153

Views

Adding a gatling test to a Spring Boot gradle project on IntelliJ

I have a Spring Boot 2 application written in Kotlin (could be Java). The project uses gradle (not maven). The application exposes HTTP endpoints that I want to load test using gatling. I created a MySimulation.scala file under src/test/gatling. IntelliJ suggested and I accepted the intallation of...
Paulo Merson
1

votes
0

answer
37

Views

Gatling logs in Json

usually Gatling's stdout looks like this: ================================================================================ 2018-10-14 22:37:13 3035s elapsed ---- Requests ------------------------------------------------------------------ > Global...
Bruno René Santos
1

votes
1

answer
113

Views

Access gatling session state within karate feature

I would like to access the gatling session from within a karate feature. Is this possible? For example there is a userId field present in the gatling session which I want to use. My use case: I have a feature in which I create a so called app, and each app needs a unique appId, therefore I want to...
leozilla
1

votes
1

answer
167

Views

Gatling: Random Feeder POST request: not found: value email (Gatling 3.0.0)

**Randomized Load Testing with Gatling ** I want to test my built API for higher load, and therefore, I have to generate huge amount of random emails (I know there is currently no email-checking on the server, so I just create random strings). The tool I use is gatling-charts-highcharts-bundle-3.0....
themysteriousM
1

votes
1

answer
30

Views

How to send the file returned from a function over post in GatLing-Scala?

def siteNameChange():File={ for(linesiteNameChange())).asJSON) Hello I am a newbie to Gatling, using it for performance testing. I have a function named siteNameChange() which returns a file after doing some modifications on the file. This function I am calling in the scenario body to send the data....
Yash Bansal
1

votes
0

answer
34

Views

How can I abort a Gatling simulation if the test system is not in the right state?

The target system I am load testing has a mode that indicates if it's suitable for running a load test against. I want to check that mode once only at the beginning of my simulation (i.e. I don't want to do the check over and over for each user in the sim). This is what I've come up with, but System...
Shorn
1

votes
0

answer
61

Views

How to extract field from JSON file with Gatling

I'm new in Gatling and Scala. I'm trying to write scenarios to test an API and do some http requests. I have a JSON file with an array of object. I'd like to extract the ID field in order to achieve an http request with it (multiple get). I'm trying to use feeder, i'm not sure about how it's working...
Yoann
1

votes
0

answer
29

Views

Extract or get parameters from url in Gatling

In Gatling how do I proceed to extract or get and save the Url parameters from response body? I make a post request and as response body a I got a link with parameters (pstId & autId) that I would like to extract and save them: /**** HTTP Calls ****/ def getResource() = { exec( http('psu initiates p...
gerard talla
1

votes
0

answer
36

Views

How can testing a ASP.NET using Integrated Windows Authentication web app with LOCUST or GATLİNG

İ want to write load testing asp.net web app using gatling or locus but this app use windows authentication.. How can ı do that .. Thank you.
Hakan Turğay
1

votes
0

answer
41

Views

Small number causes java.lang.ClassCastException when snakeyaml deserialized object is passed to Gatling feeder

I'm running a gatling simulation that uses numeric input from a yml file to feed its scenario. Everything works when my numeric inputs are large enough that they cannot be parsed as instances of java.lang.Integer, but small numeric values are apparently parsed to Integers and result in a ClassCastEx...
Justin Blank
1

votes
0

answer
26

Views

How to get Gatling Karate Simulation response

val protocol = karateProtocol() val create = scenario('create').exec(karateFeature('classpath:mock/cats-create.feature')) setUp( create.inject(rampUsers(10) over (5 seconds)).protocols(protocol) ) For the code above, it is using Gatling to simulate karate service. Is there a way that I can get the h...
Silu Zhao
1

votes
1

answer
37

Views

Karate Gatling Project - AbstractMethodError

I am running the karate gatling sample program under Gatling version 3.0.3. I got this error when I want to call KarateProtocol. val pro = karateProtocol() val auth = scenario('custom').exec(karateFeature('classpath:mock/AuthenticateUser.feature')) 16:20:30.269 [ERROR] i.g.a.Gatling$ - Run crashed...
Silu Zhao
1

votes
1

answer
28

Views

How to Invoke Gatling successfulRequests Assert for All Feature File Requests

For my performance test, an insignificant number of requests are failing the feature file assert for not having associated data needed for a subsequent request. In my scala file I have: global.successfulRequests.percent.is(99) But it seems the feature file assert is still requiring 100% success: >...
anutter
1

votes
1

answer
35

Views

Report generation fails

We are trying to use Karate/Gatling for performance tests and very often the run succeeds but the results are not generated with this error. java.lang.IllegalStateException: cannot create children while terminating or terminated at akka.actor.dungeon.Children.makeChild(Children.scala:270) I can see...
kCliff
1

votes
1

answer
37

Views

karate-gatling: How to exclude setup/create from simulation response time?

I'm trying to set/enforce performance SLAs on endpoints for a service. Some of the tests have a create step which will create an account using an API call. The create step can take a second or two. I'm trying to measure/set assertions on the performance of the GET (~50ms) without including the time...
ericdriggs
1

votes
1

answer
19

Views

Issue with inject profile when running a performace test

I have a performance test set up using the gatling plugin. The simulation works if I use constantUsersPerSec in the load profile. If I change this to atOnceUsers then the simulation does not run. No load is generated I have tried the other injection types eg rampUsers and this also works. It see...
Pablo
0

votes
0

answer
3

Views

How to properly use checkIf with multiple jsonPath extractions

I've got scenario that I send GET request which sometimes can return 404 and I don't want to report it as an error on the final reports. Additionally if that request is successful I need to extract multiple values from json response. Generally those 2 actions I want to use work for me fine when used...
Michal
1

votes
1

answer
553

Views

Does group { } finish before control passes to next block command in chain?

I have a Gatling (1.5.5) scenario that looks something like this: .group( 'name' ) { // do a sequence of things that are a logical flow (in this case, log in) .exitHereIfFailed } .feed( source ) .exec( session => println( some.value.in.session ) ) .group( 'next step' ) { ... } What I expected was, i...
John Arrowwood

View additional questions