How to run load test for specific duration?

I have tried

.during (300 seconds)

{

–executable script–

}
and also tried
setUp(scn.inject(rampUsers(200) over (100 seconds), during (560 seconds))).protocols(httpProtocol)

but none of above option works however if I remove the duration clause and just it with 100 seconds ramp test runs fine.

I searched like entire internet but didn’t found any hint or solution on this.
Also I am using csv feeder for username password and kept the data extraction circular for CSV still I am getting error after sometime into test saying “no attribute found for username”
CSV file looks like this, I don’t know why gatling has so weirdo format of csv rather than having it simple like jmeter.
username,passwordj2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2eej2ee,j2ee

I have kept the csv like below first but it didn’t worked then I found above sample somewhere which I referred.
username,password
j2ee,j2ee

My code is
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import scala.concurrent.duration._

class LoginRecordedSimulation extends Simulation {

val httpProtocol = http
.baseURL(“http://localhost:8080”)
.inferHtmlResources()
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”)
.acceptEncodingHeader(“gzip, deflate, sdch”)
.acceptLanguageHeader(“en-US,en;q=0.8”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36”)

val headers_0 = Map(“Upgrade-Insecure-Requests” → “1”)

val headers_2 = Map(
“Accept-Encoding” → “gzip, deflate”,
“Origin” → “http://localhost:8080”,
“Upgrade-Insecure-Requests” → “1”)

val headers_3 = Map(“Accept” → “image/webp,image/,/*;q=0.8”)

val csvfeeder = csv(“username.csv”).circular

val uri1 = “http://localhost:8080/jpetstore

val scn = scenario(“LoginRecordedSimulation”)
.during (560 seconds)
{

.exec(http("request_0")
    .get("/jpetstore")
    .headers(headers_0))
.pause(8)
.exec(http("request_1")
    .get("/jpetstore/shop/signonForm.shtml;jsessionid=5C5EC505BC93B2756A9F83F0308B8E61")
    .headers(headers_0))
.pause(5)
.exec(http("request_2")
    .post("/jpetstore/shop/signon.shtml")
    .headers(headers_2)
    .formParam("username", "${username}")
    .formParam("password", "${password}")
    .formParam("submit", "Login")
    .resources(http("request_3")
    .get("/jpetstore/images/banner_dogs.gif")
    .check(regex("Welcome").exists)
    .headers(headers_3)))
.pause(6)
.exec(http("request_4")
    .get("/jpetstore/shop/viewCategory.shtml?categoryId=DOGS")
    .headers(headers_0))
.pause(2)
.exec(http("request_5")
    .get("/jpetstore/shop/viewProduct.shtml?productId=K9-BD-01")
    .headers(headers_0))
.pause(12)
.exec(http("request_6")
    .get("/jpetstore/shop/viewItem.shtml?itemId=EST-6")
    .headers(headers_0)
    .resources(http("request_7")
    .get("/jpetstore/images/dog2.gif")
    .headers(headers_3)))
.pause(6)
.exec(http("request_8")
    .get("/jpetstore/shop/addItemToCart.shtml?workingItemId=EST-6")
    .headers(headers_0))
.pause(8)
.exec(http("request_9")
    .get("/jpetstore/shop/removeItemFromCart.shtml?workingItemId=EST-6")
    .headers(headers_0))
.pause(7)
.exec(http("request_10")
    .get("/jpetstore/shop/signoff.shtml")
    .headers(headers_0))

}
setUp(scn.inject(rampUsers(200) over (100 seconds))).protocols(httpProtocol)
}