How to user a repeat countername with dates

.repeat(2,“DAY”){

.param(""“tripDay”"", “”“2013-05-”${DAY}"""")

}

its not working

Don’t have an extra quote?
Isn’t it supposed to be .param(""“tripDay”"", “”“2013-05-${DAY}”"")?

cheers
Nicolas

still didn’t work, meaning that it only loops once, not twice

.param(""“tripDay”"", “”“2013-05-$DAY”"")

Do you have a more complete piece of code to show?
What you showed is not any valid code and I don’t really get what you are trying to achieve here.

.repeat(2,“DAY”){
exec(http(“request_42”)
.post(“https://server1.com/userportal/trips/save”)
.headers(headers_42)
.param(""“id”"", “”"""")
.param(""“commuteDistance”"", “”"""")
.param(""“customFields[purpose]”"", “”“Visit to Everything Just A Buck”"")
.param(""“distance”"", “”“0"”")
.param(""“sequenceNum”"", “”“1"”")
.param(""“tripDay”"", “”“2013-05-${DAY}”"")
.param(""“unit”"", “”“MILES”"")
.param(""“toLocationAddress”"", “”“3300 Broadway St, Eureka, CA 95501, USA”"")
.param(""“toLocationClientLocationId”"", “”“1007"”")
.param(""“toLocationDataEntrySourceName”"", “”“browser”"")
.param(""“toLocationDetectedMilliseconds”"", “”“1370460506342"”")
.param(""“toEndDayStop”"", “”“false”"")
.param(""“toLocationId”"", “”“1027"”")
.param(""“toLocationIsGoogleVerified”"", “”“true”"")
.param(""“toLocationLatitude”"", “”“40.779146"”")
.param(""“toLocationLongitude”"", “”"-124.18738""")
.param(""“toLocationName”"", “”“Everything Just A Buck”"")
.param(""“toLocationPersonLocationId”"", “”“2092"”")
.param(""“fromLocationAddress”"", “”“1615 Alexander Ln, Grants Pass, OR 97527, USA”"")
.param(""“fromLocationDetectedMilliseconds”"", “”“1370460506342"”")
.param(""“fromLocationId”"", “”“40980"”")
.param(""“fromLocationIsGoogleVerified”"", “”“true”"")
.param(""“fromLocationName”"", “”“Base Location”"")

)
}

I should also mention that the value returned is always 0

I think the issue is that its not incrementing the count.

I cleaned up by code a little.

package junk
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
import assertions._

class junk extends Simulation {

val httpConf = httpConfig
.baseURL(“https://server1.com:443”)
.acceptHeader(“image/png,image/;q=0.8,/*;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.connection(“keep-alive”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0”)

val headers_1 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“Cache-Control” → “”“max-age=0"”"
)

val headers_21 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“Cache-Control” → “”“no-cache”"",
“Content-Type” → “”“application/x-www-form-urlencoded; charset=UTF-8"”",
“Pragma” → “”“no-cache”"",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_22 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”"
)

val headers_23 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“If-Modified-Since” → “”“Mon, 03 Jun 2013 08:58:40 GMT”""
)

val headers_31 = Map(
“Accept” → “”“application/json, text/javascript, /; q=0.01"”",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_33 = Map(
“Accept” → “”"/""",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_42 = Map(
“Accept” → “”"/""",
“Cache-Control” → “”“no-cache”"",
“Content-Type” → “”“application/x-www-form-urlencoded; charset=UTF-8"”",
“Pragma” → “”“no-cache”"",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val scn = scenario(“Scenario Name”)

.exec(http(“request_1”)
.get(“https://server1.com/”)
.headers(headers_1)
)

.pause(450 milliseconds)
.exec(http(“request_21”)
.post(“https://server1.com/system/login.php”)
.headers(headers_21)
.param(""“username”"", “”“133873"”")
.param(""“password”"", “”“1"”")
.param(""“ajaxLogin”"", “”“1"”")
)

.exec(http(“request_31”)
.get(“https://server1.com/userportal/settings/person/current/userportal.mileage”)
.headers(headers_31)
.queryParam(""“startDate”"", “”“2013-06-05"”")
.queryParam(""“endDate”"", “”“2013-06-06"”")
)

.pause(6)
.repeat(2,“DAY”){
exec(http(“request_42”)
.post(“https://server1.com/userportal/trips/save”)
.headers(headers_42)
.param(""“id”"", “”"""")
.param(""“commuteDistance”"", “”"""")
.param(""“customFields[purpose]”"", “”“Visit to Everything Just A Buck “””)
.param(""“distance”"", “”“0"”")
.param(""“sequenceNum”"", “”“1"”")
.param(""“tripDay”"", “”“2013-06-0${DAY}”"")
.param(""“unit”"", “”“MILES”"")
.param(""“toLocationAddress”"", “”“3300 Broadway St, Eureka, CA 95501, USA”"")
.param(""“toLocationClientLocationId”"", “”“1007"”")
.param(""“toLocationDataEntrySourceName”"", “”“browser”"")
.param(""“toLocationDetectedMilliseconds”"", “”“1370460506342"”")
.param(""“toEndDayStop”"", “”“false”"")
.param(""“toLocationId”"", “”“1027"”")
.param(""“toLocationIsGoogleVerified”"", “”“true”"")
.param(""“toLocationLatitude”"", “”“40.779146"”")
.param(""“toLocationLongitude”"", “”"-124.18738""")
.param(""“toLocationName”"", “”“Everything Just A Buck”"")
.param(""“toLocationPersonLocationId”"", “”“2092"”")
.param(""“fromLocationAddress”"", “”“1615 Alexander Ln, Grants Pass, OR 97527, USA”"")
.param(""“fromLocationDetectedMilliseconds”"", “”“1370460506342"”")
.param(""“fromLocationId”"", “”“40980"”")
.param(""“fromLocationIsGoogleVerified”"", “”“true”"")
.param(""“fromLocationName”"", “”“Base Location”"")

)

.pause(6)
}
.exec(http(“request_43”)
.get(“https://server1.com/userportal/logout”)
.headers(headers_22)
)
.pause(714 milliseconds)

setUp(scn.users(1).protocolConfig(httpConf))
}

OK guys I know what the issue is, just don’t know how to fix it.

First, the repeat is working just fine. the issue is the counter. so if I have the following .repeat(2,“Val1”){} I notiec that the count starts at 0 not 1 and ends at 1 so its counting from 1 to 1. how do I make it start at 1 ?

.param(""“tripDay”"", session => “2013-06-0” + (session.getTypedAttributeInt + 1))

not working for me. this is what I have

package junk
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
import assertions._

class junk extends Simulation {

val httpConf = httpConfig
.baseURL(“https://server1.com:443”)
.acceptHeader(“image/png,image/;q=0.8,/*;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.connection(“keep-alive”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0”)

val headers_1 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:55 GMT”"",
“If-None-Match” → “”"“418d7-152d-4ddf06a786417"”""
)

val headers_2 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40eca-734-4ddf06a75899f”"""
)

val headers_3 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:55 GMT”"",
“If-None-Match” → “”"“4187a-333-4ddf06a78585f”"""
)

val headers_4 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:55 GMT”"",
“If-None-Match” → “”"“418a4-303-4ddf06a78602f”"""
)

val headers_5 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“Cache-Control” → “”“no-cache”"",
“Content-Type” → “”“application/x-www-form-urlencoded; charset=UTF-8"”",
“Pragma” → “”“no-cache”"",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_6 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”"
)

val headers_7 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“If-Modified-Since” → “”“Mon, 03 Jun 2013 08:58:40 GMT”""
)

val headers_8 = Map(
“Accept” → “”“text/css,/;q=0.1"”",
“If-Modified-Since” → “”“Mon, 03 Jun 2013 08:59:20 GMT”""
)

val headers_9 = Map(
“Accept” → “”"/""",
“If-Modified-Since” → “”“Mon, 03 Jun 2013 08:59:20 GMT”""
)

val headers_11 = Map(
“If-Modified-Since” → “”“Mon, 03 Jun 2013 08:58:40 GMT”""
)

val headers_14 = Map(
“Accept” → “”“application/json, text/javascript, /; q=0.01"”",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_15 = Map(
“Accept” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”",
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“401ff-47e-4ddf06a6f3487"”""
)

val headers_16 = Map(
“Accept” → “”"/""",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_25 = Map(
“Accept” → “”"/""",
“Cache-Control” → “”“no-cache”"",
“Content-Type” → “”“application/x-www-form-urlencoded; charset=UTF-8"”",
“Pragma” → “”“no-cache”"",
“X-Requested-With” → “”“XMLHttpRequest”""
)

val headers_27 = Map(
“Accept” → “”"/""",
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:55 GMT”"",
“If-None-Match” → “”"“41b06-1faca-4ddf06a78ae4f”"""
)

val headers_28 = Map(
“Accept” → “”“text/css,/;q=0.1"”",
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ec2-208a4-4ddf06a7579ff”"""
)

val headers_29 = Map(
“Accept” → “”"/""",
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ec3-a9c23-4ddf06a7585b7"”""
)

val headers_30 = Map(
“Accept” → “”"/""",
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ec7-2211-4ddf06a75899f”"""
)

val headers_31 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407c5-4da-4ddf06a73ff17"”""
)

val headers_32 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407c2-4d4-4ddf06a73ff17"”""
)

val headers_33 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407c7-acdf-4ddf06a73ff17"”""
)

val headers_34 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ecd-e3b3-4ddf06a75899f”"""
)

val headers_35 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ecf-6df-4ddf06a75899f”"""
)

val headers_36 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40ecc-39d-4ddf06a75899f”"""
)

val headers_37 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407ee-39f8-4ddf06a741687"”""
)

val headers_38 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407eb-a50c-4ddf06a741687"”""
)

val headers_39 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“407c6-909-4ddf06a73ff17"”""
)

val headers_41 = Map(
“If-Modified-Since” → “”“Thu, 30 May 2013 14:35:54 GMT”"",
“If-None-Match” → “”"“40325-19b3-4ddf06a73d807"”""
)

val scn = scenario(“Scenario Name”)
.exec(http(“request_1”)
.get(“https://server1.com/scripts/ext-3.3.3/resources/images/default/panel/tool-sprites.gif”)
.headers(headers_1)
.check(status.is(304))
)
.pause(74 milliseconds)
.exec(http(“request_2”)
.get(“https://server1.com/resources/img/gadget-body-bg.gif”)
.headers(headers_2)
.check(status.is(304))
)
.pause(12 milliseconds)
.exec(http(“request_3”)
.get(“https://server1.com/scripts/ext-3.3.3/resources/images/default/form/text-bg.gif”)
.headers(headers_3)
.check(status.is(304))
)
.pause(6)
.exec(http(“request_4”)
.get(“https://server1.com/scripts/ext-3.3.3/resources/images/default/grid/loading.gif”)
.headers(headers_4)
.check(status.is(304))
)
.pause(5)
.exec(http(“request_5”)
.post(“https://server1.com/system/login.php”)
.headers(headers_5)
.param(""“username”"", “”“133873"”")
.param(""“password”"", “”“1"”")
.param(""“ajaxLogin”"", “”“1"”")
)
.pause(472 milliseconds)

.repeat(2,“DAY”){
exec(http(“request_6”)
.get(“https://server1.com/system/”)
.headers(headers_6)
)
.pause(943 milliseconds)
.exec(http(“request_7”)
.get(“https://server1.com/userportal/resources/images/favicon.ico”)
.headers(headers_7)
.check(status.is(304))
)
.pause(11 milliseconds)
.exec(http(“request_8”)
.get(“https://server1.com/userportal/resources/css/userportal.css”)
.headers(headers_8)
.check(status.is(304))
)
.pause(90 milliseconds)
.exec(http(“request_9”)
.get(“https://server1.com/userportal/resources/js/userportal.js”)
.headers(headers_9)
.check(status.is(304))
)
.pause(463 milliseconds)
.exec(http(“request_10”)
.get(“https://server1.com/userportal/resources/fonts/proximanova-regular-webfont.woff”)
.headers(headers_7)
.check(status.is(304))
)
.pause(125 milliseconds)
.exec(http(“request_11”)
.get(“https://server1.com/userportal/resources/images/crs-loader.gif”)
.headers(headers_11)
.check(status.is(304))
)
.exec(http(“request_12”)
.get(“https://server1.com/userportal/resources/fonts/crs.woff”)
.headers(headers_7)
.check(status.is(304))
)
.exec(http(“request_13”)
.get(“https://server1.com/userportal/resources/fonts/proximanova-semibold-webfont.woff”)
.headers(headers_7)
.check(status.is(304))
)
.pause(19 milliseconds)
.exec(http(“request_14”)
.get(“https://server1.com/userportal/settings/person/current/userportal.mileage”)
.headers(headers_14)
.queryParam(""“startDate”"", “”“2013-06-06"”")
.queryParam(""“endDate”"", “”“2013-06-07"”")
)
.pause(161 milliseconds)
.exec(http(“request_15”)
.get(“https://server1.com/favicon.ico”)
.headers(headers_15)
.check(status.is(304))
)
.pause(1)
.exec(http(“request_16”)
.get(“https://server1.com/userportal/async/status/personSyncJob”)
.headers(headers_16)
)
.pause(467 milliseconds)
.exec(http(“request_17”)
.get(“https://server1.com/userportal/resources/images/icon-calendar.gif”)
.headers(headers_11)
.check(status.is(304))
)
.exec(http(“request_18”)
.get(“https://server1.com/userportal/resources/images/pdficon.png”)
.headers(headers_11)
.check(status.is(304))
)
.pause(48 milliseconds)

.exec(http(“request_19”)
.get(“https://server1.com/userportal/period/favr/current”)
.headers(headers_14)
)
.pause(103 milliseconds)
.exec(http(“request_20”)
.get(“https://server1.com/userportal/settings/person/current/userportal.mileage”)
.headers(headers_14)
.queryParam(""“startDate”"", “”“2013-06-01"”")
.queryParam(""“endDate”"", “”“2013-06-30"”")
)
.pause(118 milliseconds)
.exec(http(“request_21”)
.get(“https://server1.com/userportal/trips/list”)
.headers(headers_14)
.queryParam(""“startDate”"", “”“2013-06-01"”")
.queryParam(""“endDate”"", “”“2013-06-30"”")
)
.pause(338 milliseconds)
.exec(http(“request_22”)
.get(“https://server1.com/userportal/resources/images/fallback_bg_navicon.png”)
.headers(headers_11)
.check(status.is(304))
)
.pause(15)
.exec(http(“request_23”)
.get(“https://server1.com/userportal/location/find”)
.headers(headers_16)
.queryParam(""“address”"", “”“3300 Broadway St, Eureka, CA 95501, USA”"")
.queryParam(""“day”"", session =>""“2013-06-0+ (session.getTypedAttributeInt + 1))”"")
.queryParam(""“maxResults”"", “”“5"”")
)
.pause(116 milliseconds)

.pause(5)
.exec(http(“request_25”)
.post(“https://server1.com/userportal/trips/save”)
.headers(headers_25)
.param(""“id”"", “”"""")
.param(""“commuteDistance”"", “”"""")
.param(""“customFields[purpose]”"", “”“Visit to Everything Just A Buck”"")
.param(""“distance”"", “”“0"”")
.param(""“sequenceNum”"", “”“1"”")
.param(""“tripDay”"", session =>""“2013-06-0”+ (session.getTypedAttributeInt + 1))""")
.param(""“unit”"", “”“MILES”"")
.param(""“toLocationAddress”"", “”“3300 Broadway St, Eureka, CA 95501, USA”"")
.param(""“toLocationClientLocationId”"", “”“1007"”")
.param(""“toLocationDataEntrySourceName”"", “”“browser”"")
.param(""“toLocationDetectedMilliseconds”"", “”“1370525760179"”")
.param(""“toEndDayStop”"", “”“false”"")
.param(""“toLocationId”"", “”“1027"”")
.param(""“toLocationIsGoogleVerified”"", “”“true”"")
.param(""“toLocationLatitude”"", “”“40.779146"”")
.param(""“toLocationLongitude”"", “”"-124.18738""")
.param(""“toLocationName”"", “”“Everything Just A Buck”"")
.param(""“toLocationPersonLocationId”"", “”“2092"”")
.param(""“fromLocationAddress”"", “”“1615 Alexander Ln, Grants Pass, OR 97527, USA”"")
.param(""“fromLocationDetectedMilliseconds”"", “”“1370525760179"”")
.param(""“fromLocationId”"", “”“40980"”")
.param(""“fromLocationIsGoogleVerified”"", “”“true”"")
.param(""“fromLocationName”"", “”“Base Location”"")
)
.pause(2)
}
.exec(http(“request_26”)
.get(“https://server1.com/userportal/logout”)
.headers(headers_6)
)
.pause(538 milliseconds)
.exec(http(“request_27”)
.get(“https://server1.com/scripts/prototype.js”)
.headers(headers_27)
.check(status.is(304))
)
.exec(http(“request_28”)
.get(“https://server1.com/resources/2b6c732475f91ffbb3899572fe8af89f.css”)
.headers(headers_28)
.check(status.is(304))
)
.exec(http(“request_29”)
.get(“https://server1.com/resources/c07b311750fa627de90d4a5ef3f39337.js”)
.headers(headers_29)
.check(status.is(304))
)
.pause(94 milliseconds)
.exec(http(“request_30”)
.get(“https://server1.com/resources/fcb9dbfd662b6128f2c6611a65a3fbfe.js”)
.headers(headers_30)
.check(status.is(304))
)
.pause(481 milliseconds)
.exec(http(“request_31”)
.get(“https://server1.com/layouts/marketing/img/corner4.gif”)
.headers(headers_31)
.check(status.is(304))
)
.pause(34 milliseconds)
.exec(http(“request_32”)
.get(“https://server1.com/layouts/marketing/img/corner1.gif”)
.headers(headers_32)
.check(status.is(304))
)
.exec(http(“request_33”)
.get(“https://server1.com/layouts/marketing/img/hero.jpg”)
.headers(headers_33)
.check(status.is(304))
)
.pause(11 milliseconds)
.exec(http(“request_34”)
.get(“https://server1.com/resources/img/logo-with-header.jpg”)
.headers(headers_34)
.check(status.is(304))
)
.exec(http(“request_35”)
.get(“https://server1.com/resources/img/primary-btn-bg.gif”)
.headers(headers_35)
.check(status.is(304))
)
.pause(11 milliseconds)
.exec(http(“request_36”)
.get(“https://server1.com/resources/img/icons-sprite.gif”)
.headers(headers_36)
.check(status.is(304))
)
.exec(http(“request_37”)
.get(“https://server1.com/layouts/marketing/img/nav-module-sprite.jpg”)
.headers(headers_37)
.check(status.is(304))
)
.pause(35 milliseconds)
.exec(http(“request_38”)
.get(“https://server1.com/layouts/marketing/img/nav-module-image-sprite.jpg”)
.headers(headers_38)
.check(status.is(304))
)
.pause(107 milliseconds)
.exec(http(“request_39”)
.get(“https://server1.com/layouts/marketing/img/footer-fade.gif”)
.headers(headers_39)
.check(status.is(304))
)
.pause(91 milliseconds)
.exec(http(“request_40”)
.get(“https://server1.com/favicon.ico”)
.headers(headers_15)
.check(status.is(304))
)
.exec(http(“request_41”)
.get(“https://server1.com/images/glyphs/ribon_serverinfo_o.png”)
.headers(headers_41)
.check(status.is(304))
)

setUp(scn.users(1).protocolConfig(httpConf))
}

IT WORKED! I had an extra “)” in the code

Thank you so much!

You really have to be more explicit about “not working”.

yep I will next time