# the correct way to use request groups in gatling2 M3a

**URL:** <https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511>\
**Category:** Gatling (Open-Source)\
**Created:** [July 29, 2013, 1:55pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511 "2013-07-29T13:55:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vova\_Polishchuk](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Vova\_Polishchuk](https://community.gatling.io/u/Vova_Polishchuk)\
**Post date:** [July 29, 2013, 1:55pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/1 "2013-07-29T13:55:02Z")

</div>

hi again, i used the convenient way of grouping requests in gatling 1 and would like to do something like that now.

but when i do something like

val scn = scenario(“Some scenario”)  
group(“group 1”) {  
exec(http(“Open page”)  
.get("/page")  
.headers(headers\_73))  
.pause(0, 7)  
}  
.group(“other page”) {  
exec(http(“Open other page”)  
.get("/promotions")  
.headers(headers\_73)  
)  
}

the result is

Simulation wpl20.TestScenario started…

16:45:13.737 [DEBUG] o.j.n.c.s.n.SelectorUtil - Using select timeout of 500  
16:45:13.741 [DEBUG] o.j.n.c.s.n.SelectorUtil - Epoll-bug workaround enabled = false  
16:45:14.119 [DEBUG] o.j.n.c.DefaultChannelFuture - The dead lock checker in DefaultChannelFuture has been disabled as requested at your own risk.  
16:45:14.201 [DEBUG] c.n.h.c.p.n.NettyAsyncHttpProvider -  
Non cached request  
DefaultHttpRequest(chunked: false)  
GET /KQUcD HTTP/1.1  
Host: goo.gl  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8  
Accept-Language: en-US,en;q=0.5  
Connection: keep-alive  
Accept-Encoding: gzip  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

using Channel  
[id: 0xc0a4efa7]

16:45:14.302 [DEBUG] c.n.h.c.p.n.NettyAsyncHttpProvider -

Request DefaultHttpRequest(chunked: false)  
GET /KQUcD HTTP/1.1  
Host: goo.gl  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8  
Accept-Language: en-US,en;q=0.5  
Connection: keep-alive  
Accept-Encoding: gzip  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

Response DefaultHttpResponse(chunked: false)  
HTTP/1.1 301 Moved Permanently  
Content-Type: text/html; charset=UTF-8  
Pragma: no-cache  
Expires: Mon, 01 Jan 1990 00:00:00 GMT  
Location: [http://gatling-tool.org/2.0.0-M3](http://gatling-tool.org/2.0.0-M3)  
X-Content-Type-Options: nosniff  
X-Frame-Options: SAMEORIGIN  
X-XSS-Protection: 1; mode=block  
Server: GSE  
Cache-Control: no-cache, no-store, max-age=0, must-revalidate  
Age: 124  
Content-Length: 214

16:45:14.304 [DEBUG] c.n.h.c.p.n.NettyConnectionsPool - Adding uri: [http://goo.gl:80](http://goo.gl:80) for channel [id: 0xc0a4efa7, /172.29.46.144:56089 =\> goo.gl/173.194.112.196:80]  
16:45:14.319 [INFO] i.g.c.r.Runner - Total number of users : 1  
16:45:14.323 [INFO] i.g.c.r.t.Terminator - Initializing  
16:45:14.324 [INFO] i.g.c.r.t.Terminator - Expecting 1 EndUser messages to terminate  
16:45:14.324 [INFO] i.g.c.r.t.Terminator - Initialized  
16:45:14.336 [INFO] i.g.c.r.w.FileDataWriter - Initializing  
16:45:14.337 [INFO] i.g.c.r.w.ConsoleDataWriter - Initializing  
16:45:14.340 [INFO] i.g.c.r.t.Terminator - DataWriter registered  
16:45:14.340 [INFO] i.g.c.r.t.Terminator - DataWriter registered  
16:45:14.340 [INFO] i.g.c.r.w.FileDataWriter - Going on with initialization after Terminator registration  
16:45:14.341 [INFO] i.g.c.r.w.ConsoleDataWriter - Going on with initialization after Terminator registration  
16:45:14.349 [INFO] i.g.c.r.w.ConsoleDataWriter - Initialized  
16:45:14.350 [INFO] i.g.c.r.w.FileDataWriter - Initialized  
16:45:14.351 [DEBUG] i.g.c.r.Runner - Launching All Scenarios  
16:45:14.358 [DEBUG] i.g.c.r.Runner - Finished Launching scenarios executions  
16:45:14.362 [INFO] i.g.c.a.UserStart - Start user #0  
16:45:14.364 [INFO] i.g.c.a.UserEnd - End user #0  
16:45:14.367 [INFO] i.g.c.r.t.Terminator - Asking DataWriters to flush

---

<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 29, 2013, 1:57pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/2 "2013-07-29T13:57:27Z")

</div>

Hi,

Which version do you use?

---

<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 29, 2013, 1:58pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/3 "2013-07-29T13:58:04Z")

</div>

Sorry, it was in the title.

---

<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 29, 2013, 2:02pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/4 "2013-07-29T14:02:20Z")

</div>

That’s just a race condition with the timer asking to display the console info one last time just after it was asked for shutdown.  
Just ignore it, we’ll clean this up in the next release.

Thanks for reporting.

---

<div class="post-metadata">

**Author:** ![Vova\_Polishchuk](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Vova\_Polishchuk](https://community.gatling.io/u/Vova_Polishchuk)\
**Post date:** [July 29, 2013, 2:13pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/5 "2013-07-29T14:13:20Z")

</div>

thank you for fast reply

but i expect the scenarios to actually send requests ) and they dont do that if i try to use groups

here is an example scenario

package wpl20

import io.gatling.http.Predef.\_  
import io.gatling.core.scenario.Simulation  
import io.gatling.core.Predef.\_  
import scala.concurrent.duration.\_  
import bootstrap.\_  
import assertions.\_

class TestScenario extends Simulation {

val httpConf = http  
.baseURL(“[http://edition.cnn.com](http://edition.cnn.com)”)  
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
.acceptEncodingHeader(“gzip, deflate”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.connection(“keep-alive”)  
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36”)  
.disableFollowRedirect

val scn = scenario(“Navigation”)  
group(“Home page”) {  
exec(http(“Open home page”)  
.get("/")  
.headers(headers\_73))  
.pause(0, 7)  
}  
group(“world page”) {  
exec(http(“Open world page”)  
.get("/WORLD/")  
.headers(headers\_73)  
)  
}

setUp(scn.inject(ramp(2 users) over (30 seconds))).protocols(httpConf)

}

---

<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 29, 2013, 2:18pm UTC](https://community.gatling.io/t/the-correct-way-to-use-request-groups-in-gatling2-m3a/511/6 "2013-07-29T14:18:49Z")

</div>

There’s dots missing in front of your group method calls (just like in Gatling 1).

val scn = scenario(“Navigation”)  
.group(“Home page”) {  
exec(http(“Open home page”)  
.get("/")  
.headers(headers\_73))  
.pause(0, 7)  
}  
.group(“world page”) {  
exec(http(“Open world page”)  
.get("/WORLD/")  
.headers(headers\_73)  
)  
}
