Dear all forumers, I had a login request which is https protocol. How to code it? I had search online but found nothing. Hope someone can help.
Gatling version: 3.11.5
Gatling flavor: java
Gatling build tool: maven
Dear all forumers, I had a login request which is https protocol. How to code it? I had search online but found nothing. Hope someone can help.
Gatling version: 3.11.5
Gatling flavor: java
Gatling build tool: maven
From the scripting pov, the only difference between HTTP and HTTPS is an s
in the scheme.
I don’t understand how and why you’re struggling.
Please share what you’ve done and how you’re struggling.
Dear forumers, I had coded the folling task.
public class orangehrm extends Simulation{
// Add the HttpProtocolBuilder:
HttpProtocolBuilder httpProtocol =
http.baseUrl("https://opensource-demo.orangehrmlive.com/web/index.php/auth/login")
.acceptHeader("application/json")
.contentTypeHeader("application/json");
// Add the ScenarioBuilder:
ScenarioBuilder homepageScenario = scenario("Homepage Street Testing Scenario")
.exec(http("Homepage Request").get("/"));
{
setUp(
homepageScenario.injectOpen(constantUsersPerSec(100000).during(3600))
).protocols(httpProtocol);
}
}
As you can see from the website, the login request is essential to all subsequent request.
Task:
Please help me. I’m totlly newbie here.
So I guess you have no idea how your login works, correct?
Are you a student? Don’t you have somebody to train you?
In this case, I recommend that you learn the basics of HTTP and then use the developper tools in your browser (Network tab) to figure out how your authentication actually works. Is it a simple form POST that returns a cookies? It is something more complex like OAuth?
You can also try our Recorder.
I understand how https POST method works but I don;t know how to translate it into Gatling code. I don’t know how to download Gatling recorder (What is the link to download Gatling recorder).
I assume that you were watching Naveen’s tutorial on Gatling script.
Let me clarify on some points first:
Let me know so that I can help you further in approaching Gatling.
I know API.
I familiar with postman.
Then, check the basic components of Postman such as Header, request body, then follow this doc
to create a full request.
It is advised to use gatling-java.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.