Feeding URLs for the httpconfig?

Hi,

I recently started using gatling for our load testing. I am using Gatling2.0.0.RC1.

My application under test, is built to support tenant based architecture where each tenant will have it’s own URL which will be resolved by the application at runtime. In the Perf test scenarios, I will need to generate the load for all the tenants. Currently there are about 500 tenants, each will have it’s own URL. URLs are like below.

test-001.test.cloud.com

test-002.test.cloud.com

test-003.test.cloud.com



test-500.test.cloud.com

I can have all these URLs from a CSV file and read from the script. I wrote the following httpconfig, but wondering how can URLs from the CSV file feeded to the config? I read from the documentation that I can use BaseURLs, but I will have to give all the URLs, which seems not a good idea.

val httpConf = http
.baseURL(“https://test-500.test.cloud.com”)
.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.2; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0”)

Thanks
Dinesh

Currently, I workaround this by removing the baseurl from httpconfig and have the complete URL in the exec statements, as mentioned below.

val execLogin = exec(http(“Login”)
.post("${tenantname}/device/ota/login")
.headers(loginHeaders)
.body(StringBody(“username=myuser&password=mypassword”))
.check(status.is(200))
.check(jsonPath("$.opstatus").is(“0”))

This worked fine.

Regards
Dinesh

Hi Dinesh,

Sorry for missing out your question.
Your solution is indeed the cleanest you can achieve for your purpose :slight_smile:

Cheers,

Pierre