Gatling version: 3.11.2
Gatling flavor: java
Gatling build tool: maven
Hello,
I post a new Topic
I want to create a HTTP request, this URL :
I put the millistone & state param in json file, but after execution I got a wrong URL :
/issues?milestone=%24%7Bmilestone%7D&q=
Code source of my Gatling simutation :
public class MyGatlingSimulation extends Simulation {
String baseURL = "https://github.com/gatling/gatling/issues";
// Define your HTTP protocol configuration
HttpProtocolBuilder httpProtocol = http
.baseUrl(baseURL)
.userAgentHeader("Gatling");
// Define your JSON feeder
FeederBuilder<Object> feeder = jsonFile("data/data.json").circular();
// Define your scenario
ScenarioBuilder scenario = scenario("My Scenario")
.feed(feeder)
// Feed the JSON data to the request
.exec(http("GET Request")
.get("/")
// Concatenate the base URL with params
.queryParam("milestone", "${milestone}")
.queryParam("state", "${state}")
)
.exec(session -> {
System.out.println("SESSION : "+session.toString());
return session;
}); // Check if response status is 200
// Define your simulation setup
{
setUp(
scenario.injectOpen(
constantUsersPerSec(1).during(1)
)
).protocols(httpProtocol);
}
}
The JSON file :
[
{
"milestone":1,
"state": "open"
}
]
My question: how can I put all the fields of the JSON file in the URL parameters ?
Thanks in advance