Multiple saveAs

I try to save in session some id from a http response and it seems that only the last one is currently saved (richtexti18nUuid in the exemple)
Here my code :

.fileBody(“getPublicationInfo”, map)
.check(regex("""“uuid”,"([0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+)",“title”,""").saveAs(“uuid”))
.check(regex("""“i18nUuid”,"([0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+)",""").saveAs(“i18nUuid”))
.check(regex(""""([0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+)",“maincontent”,""").saveAs(“mainContentUuid”))
.check(regex(""""([0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+)",“rich-text”,""").saveAs(“richtextUuid”))
.check(regex("""“Rich text”,"([0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+-[0-9 a-z]+)""").saveAs(“richtexti18nUuid”))
.exec((session: Session) => {
println("richtexti18nUuid : " + session.getAttribute(“richtexti18nUuid”))
println("richtextUuid : " + session.getAttribute(“richtextUuid”))
println("uuid : " + session.getAttribute(“uuid”))
println("i18nUuid : " + session.getAttribute(“i18nUuid”))
println("mainContentUuid : " + session.getAttribute(“mainContentUuid”))

Is it possible to have more than one saveAs ? and if yes how to achieve this ?

Hi Stéphane,

See doc here:

As all the DSL elements are immutable so that they can be composed and reused, the consequence of what you wrote is that you overrode the checks previously defined.

What you have to write is check(check1, check2, check3, …)



2012/8/13 Stéphane Journiac <>

Thank you Stephane I’ll try that.


You’re welcome.
This is a common mistake, so I added a word of notice to the doc.



2012/8/13 Stéphane Journiac <>

Trying this, like described in the documentation, I get a compilation error (using 1.3.x).


type mismatch;
found : com.excilys.ebi.gatling.http.request.builder.PostHttpRequestBuilder
required: com.excilys.ebi.gatling.core.structure.ChainBuilder
10:43:25.301 [ERROR] c.e.e.g.a.ZincCompiler$ - .check(
10:43:25.301 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
10:43:25.319 [ERROR] c.e.e.g.a.ZincCompiler$ - one error found
Exception in thread “main” Compilation failed

Regards Danny

You have a parenthesis that should be here: you close the check method call after status:

.check(, // ← removed parenthesis

Ah sorry, my bad.