You’re trying to mix EL and programatic code, and that doesn’t work.
If you’re familiar with Scala: methods actually take Expressions (type alias for Session => Validation), and there’s an implicit for converting Strings into Expressions.
Here, “/search.jspa?peopleEnabled=true&q=” + EncodeURIComponent.encodeURIComponent("${queryterm})" is only evaluated once, when the Scenario is built.
What you want is (Gatling 2 master syntax):
session => “/search.jspa?peopleEnabled=true&q=” + EncodeURIComponent.encodeURIComponent(session(“queryterm”).as[String])
Depending on the version you use, the syntax for getting a session attribute might be different.
What this line does is, create the get() call with the following URL : “search.jspa?peopleEnabled=true&q=%24%7Bqueryterm%7D”
Indeed, you have encoded “${query term}”, so it’s not interpreted at runtime.