# Querystring parameters

**URL:** <https://community.gatling.io/t/querystring-parameters/475>\
**Category:** Gatling (Open-Source)\
**Created:** [July 5, 2013, 1:56pm UTC](https://community.gatling.io/t/querystring-parameters/475 "2013-07-05T13:56:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Whitby](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@Rob\_Whitby](https://community.gatling.io/u/Rob_Whitby)\
**Post date:** [July 5, 2013, 1:56pm UTC](https://community.gatling.io/t/querystring-parameters/475/1 "2013-07-05T13:56:19Z")

</div>

Hi,

I am just getting started with Gatling and am using an http access log as a feeder. Many of the entries are urls with querystring params, but simply doing a get does not include the querystring.

e.g. get(“[http://foo.com/bar?a=b](http://foo.com/bar?a=b)”) results in a request to “[http://foo.com/bar](http://foo.com/bar)”

I see in the docs the queryParam method ([https://github.com/excilys/gatling/wiki/HTTP#wiki-query-params](https://github.com/excilys/gatling/wiki/HTTP#wiki-query-params)), but how do I dynamically create these based on the values from the feeder?

Here’s my feeder:

val logFeeder = new Feeder[String] {  
val source = scala.io.Source.fromFile(accessLog).getLines

override def hasNext = source.hasNext

override def next: Map[String, String] = {  
val fields = source.next.split(" ")  
val method = fields(5)  
val path = fields(6)

if (method == "“GET”)  
Map(“ip” → ip, “path” → path)  
else  
Map()  
}  
}

and a scenario

val scn1 = scenario(“scn1”)  
.repeat(1000) {  
feed(logFeeder).exec(  
http(“accessLog”)  
.get("${path}")  
.check(status.is(200))  
)  
.pause(10 milliseconds, 100 milliseconds)  
}  
}

Thanks for any help

Rob

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [July 5, 2013, 2:16pm UTC](https://community.gatling.io/t/querystring-parameters/475/2 "2013-07-05T14:16:54Z")

</div>

Hi,  
Which version of gatling are you using?  
get("[http://foo.com/bar?a=b](http://foo.com/bar?a=b)_")_ is a valid syntax.

cheers  
Nicolas

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [July 5, 2013, 2:17pm UTC](https://community.gatling.io/t/querystring-parameters/475/3 "2013-07-05T14:17:42Z")

</div>

Hi,

Which version do you use?

I just ran a basic test with both Gatling 2 master and 1.5.2 and it work as expected:

package basic

---

<div class="post-metadata">

**Author:** ![Rob\_Whitby](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@Rob\_Whitby](https://community.gatling.io/u/Rob_Whitby)\
**Post date:** [July 5, 2013, 2:44pm UTC](https://community.gatling.io/t/querystring-parameters/475/4 "2013-07-05T14:44:40Z")

</div>

Sorry should have said, I’m using 2.0.0-M1.

I just tried the example you provided and the check failed. (had to modify it a bit, see below (httpConfig not http and protocolConfig not protocols) - guess the master has changed since M1)

import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_  
import io.gatling.jdbc.Predef.\_  
import io.gatling.http.Headers.Names.\_  
import scala.concurrent.duration.\_  
import bootstrap.\_  
import assertions.\_

class test extends Simulation {

val httpConf = httpConfig  
.baseURL(“[https://www.google.fr](https://www.google.fr)”)  
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.acceptEncodingHeader(“gzip, deflate”)

val scn = scenario(“Google”)  
.exec(http(“Hello”).get("/search?q=hello").check(regex("""

""")))

setUp(scn.inject(atOnce(1)).protocolConfig(httpConf))  
}

I’ll try with master instead.

Thanks  
Rob

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [July 5, 2013, 2:46pm UTC](https://community.gatling.io/t/querystring-parameters/475/5 "2013-07-05T14:46:51Z")

</div>

I fixed that in Gatling 2.0-M2.  
[https://github.com/excilys/gatling/commit/53cb46bc3f46c9b4692380f6ee798c0785aedcfc](https://github.com/excilys/gatling/commit/53cb46bc3f46c9b4692380f6ee798c0785aedcfc)

Could you update your code to use Gatling 2.0-M3 ?

---

<div class="post-metadata">

**Author:** ![Rob\_Whitby](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@Rob\_Whitby](https://community.gatling.io/u/Rob_Whitby)\
**Post date:** [July 5, 2013, 2:53pm UTC](https://community.gatling.io/t/querystring-parameters/475/6 "2013-07-05T14:53:59Z")

</div>

Fantastic, and thanks a lot for the quick responses!
