Run actions sequentially in scenario

79 views
Skip to first unread message

Shahenda Khaled

unread,
Jan 15, 2018, 7:03:18 AM1/15/18
to Gatling User Group
Hello, 

I'm trying to execute this scenario 

val scn = scenario("SimulationOne")
.exec(allFiltering.filtering)
.exec(CheckQualitiesClass.checkQuality)
.exec(allFiltering.finishTaskAfterQualityCheck)

but the problem is that the last action depends on a file created in the first one. The way it runs now is that it doesn't wait for the first one to finish before starting the next action which is what I want to achieve.

Can anyone help?

Thanks.

Adam Artajew

unread,
Jan 16, 2018, 4:23:36 AM1/16/18
to Gatling User Group
Hi,

try passing lambdas to defer their execution in the scenario flow, i.e.:

exec(session => allFiltering.filtering)

But remember -- the called function should return session object.

Cheers,
Adam

Vamsi

unread,
Jan 16, 2018, 3:51:53 PM1/16/18
to Gatling User Group
you can group them.
Message has been deleted

Hiranmaya Mohanty

unread,
Jan 18, 2018, 4:38:14 AM1/18/18
to Gatling User Group
The .exec requests in a  scenario do run one after the other, once the response for the earlier request has arrived.
So, if you have a problem with the last action, see if the valid response from first request actually means the file has been created or it just puts on some queue to be processed asynchronously.
Also you could try adding pauses between the requests.


On Monday, 15 January 2018 13:03:18 UTC+1, Shahenda Khaled wrote:

Shahenda Khaled

unread,
Jan 22, 2018, 5:31:31 AM1/22/18
to Gatling User Group
When I split the steps into two simulations and run them back to back, they work. I wanted something to do that in one simulation so I would have both steps in the Gatling report

Shahenda Khaled

unread,
Jan 22, 2018, 5:32:26 AM1/22/18
to Gatling User Group
Thanks for the reply but it didn't work. Still searched for the file prematurely.

Shahenda Khaled

unread,
Jan 23, 2018, 3:45:49 AM1/23/18
to Gatling User Group
Hi,

this gives me the error of 

 found   : io.gatling.core.structure.ChainBuilder
 required: io.gatling.commons.validation.Validation[io.gatling.core.session.Session]

so maybe I didn't succeed in returning the session object :)
Reply all
Reply to author
Forward
0 new messages