Updateing from M2 to M3

I am upgrading the version from 2.0.0M2 to 2.0.0.m3a. And a lot of the scripts are failed:

  1. For protocol: I used to use protocolConfig and change it to protocols according to the wiki:

Both failed:

gatling-charts-highcharts-2.0.0-M3a/user-files/simulations/test/SingleTest.scala:62: value protocols is not a member of io.gatling.core.structure.ProfiledScenarioBuilder
13:37:08.361 [ERROR] i.g.a.ZincCompiler$ - setUp(s1.inject(atOnce(1 user)).protocols(httpConf))

  1. For sessions, API change dramatically:

I don’t want the exceptions, so usually I use validate to see if it is a failure, if it is not, then I get the value out of it: Will this affect the testing since it might need to access that data twice? Also how can I check if the validation object is a failure or not?

val getBodyStringB = session(“getBodyString”).validate[String]
val blogIDB = session(“id”).validate[String]
if (getBodyStringB.result == false && blogIDB != false){ //? how to check if this is the failure or not?

}

I am upgrading the version from 2.0.0M2 to 2.0.0.m3a. And a lot of the
scripts are failed:

1. For protocol: I used to use protocolConfig and change it to protocols
according to the wiki:

Both failed:
gatling-charts-highcharts-2.0.0-M3a/user-files/simulations/test/SingleTest.scala:62:
value protocols is not a member of
io.gatling.core.structure.ProfiledScenarioBuilder
13:37:08.361 [ERROR] i.g.a.ZincCompiler$ - setUp(s1.inject(atOnce(1
user)).protocols(httpConf))

No, you've done a typo: protocols is to be chained with setUp, not inject
setUp(s1.inject(atOnce(1 user))).protocols(httpConf)

2. For sessions, API change dramatically:

I don't want the exceptions, so usually I use validate to see if it is a
failure, if it is not, then I get the value out of it: Will this affect
the testing since it might need to access that data twice?

WDYM?

Also how can I check if the validation object is a failure or not?

val getBodyStringB = session("getBodyString").validate[String]
val blogIDB = session("id").validate[String]
if (getBodyStringB.result == false && blogIDB != false){ //? how to check
if this is the failure or not?

}

I don't know what you're trying to do exactly, I would need the full code
block.
You can compose Validations with map/flatMap, or use a for comprehension

for {
   getBodyStringB <- session("getBodyString").validate[String]
   blogIDB <- session("id").validate[String]
} yield doSomethingOnlyIfBothSucceed

got it, thx!

One more comment:

I was working for my company to covert the current testcases to gatling. I have a great experience with it and Thx for the great tool.

When I started, I use version M2 to do the POC. Now since we are ready to use the gatling as our official perf tool, I would like to use the latest and greatest version which is M3a. The problem I am having is that since there are big changes on the session API, I have to change dramically on our testcases for that. (We use a lot of that) So I am wondering in the future roadmap, how possible to keep the backword compatible of those API? Since as we proceed with gatling, we will add more and more cases, but we also want to get the latest versions of gatling, that introduce the cost of upgrading the testcases.

Thx
Shawna

I’m pretty satisfied with the new Session API, so I’d be in favor of keeping it as is for the final release.
However, we definitively lack feedback from our community.
Hey people, do you like it or not?

I like the newer one too. It is much simpler and self explaintory.

Hi,

I cannot compare since I started on the latest version recently. I can say I do like Gatling 2 a lot.

However I am having hard time figuring out the right syntax of simulations in the version 2.

Basically, I am reading Gatling doc which was written for version 1 with all the syntax, declarations and great examples.

Since there were big changes in API most of the examples do not work any more. E.g. I read the version 1 HTTP page, then I read Gatling 2 update , applying that knowledge on top, then I try to write smth and guess what - the code does not compile. Trying to figure out what is wrong being new to the tool is not easy.

I guess it is a lot of work but it would be great to have updated version 2 of documentation alongside Gatling2.

Nat

Hi,

We’re aware of that, and we plan on work on this at the beginning of September.
Sorry for not being able to make it sooner…

Stéphane

Thanks, that is good to know. I look forward to it very much.
I read in one of the posts that you plan to release it in 2.4…

Best wishes,
Natalie