how to setup duration phase of test in gatling?

my aim is to run a simple test, rampup 100 users in 10 min, stay in duration phase of 1 hr doing same transactions , rampdown in 2 min

i am trying to use the below command, but don’t want to give max Duration.

setUp(scn.inject(rampUsers(100) during (10 minutes))).maxDuration(10 minutes)

can someone please help.

Tried the below one also but no luck.

setUp( scn.inject(
rampUsers( 100 ) during ( 10 minutes ),
nothingFor( 70 minutes )

pls help resolve this issue.

I was able to achieve it by adding .duration(time-required) and looping the transactions inside it.

private val scn = scenario("User login")
    .during(60 minutes) {
        exec(http("login successful")
        .body(StringBody("""{ "username": "", "password": "12345" }"""))

Hi Sunil,

glad you could figure it out. I suggest you to follow some tutorials for Gatling as this is a basic configuration. You may check on Udemy or some blog posts to expand your knowledge further.