Sequential scenario not working - andthen method not working

Hi Team,

version: 3.7.6
CompanyScenario only running for 120 seconds, after that test stopped immediately

setUp(CompanyScenario.inject(atOnceUsers(1)).andThen(contentScenario.inject(atOnceUsers(1)))).protocols(httpConf).maxDuration(120 seconds)

Hi @selva4,

What is your issue?

You have maxDuration(120 seconds) and your scenario run for 120seconds.
I don’t know what is inside your CompanyScenario and if there are loops or websocket without closing connection, it is expected that it won’t finish.


Note that you should use the latest version to comply with this community site’ guidelines.

val CompanyScenario: ScenarioBuilder = scenario(“CompanyScenario”)
.doIf((session => generateTiming(session.userId.toInt))) {
.exec(actionBuilder = http(“T02_enrich-company-” + env)
.header(“Authorization”, “Bearer ${C_jwt}”)

Don’t know why contentScenario is not running

As @sbrevet explained:

  • CompanyScenario.inject(atOnceUsers(1))

You said this scenario lasts 120 seconds

  • .andThen(contentScenario.inject(atOnceUsers(1))))

This will start make contentScenario starts after all users in CompanyScenario completes, hence after 120 seconds

  • .protocols(httpConf).maxDuration(120 seconds)

This aborts the test after 120 seconds => contentScenario never get the chance to run.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.