Тёмный

#9 - Looping Calls using Methods in  

Naveen AutomationLabs
Подписаться 389 тыс.
Просмотров 7 тыс.
50% 1

In this video, I have explained how to loop a call in Gatling using repeat api.
We can run the same request multiple times using loops in Gatling.
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Naveen AutomationLabs Paid Courses:
Java & Selenium:
naveenautomatio...
Java & API +POSTMAN + RestAssured + HttpClient:
naveenautomatio...

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@patrycjahusarska6295
@patrycjahusarska6295 2 года назад
Thank You!
@HiDiamondJi
@HiDiamondJi Год назад
I am trying to use a loop e.g. asLongAs() in Galing but not getting enough data on google about how to use. My scenrio is to open a HTML page and that page takes some time to load and for that I have a css selector to check that once the report get loaded we have one css selector to check in the source code. my code is like: exec (http("ABC -${ID} - Id -${ID2}") .get("web/a/b/c/") .check(css(.abc).saveAs("URL")) .exec(session =\> { val response = session("URL").as\[String\] println(s"url is: \ $response") session }) exec(http("Open the redirected report - ${ID1} Id-${ID2}") .get(session =\> session("URL").as\[String\]) Some checks .check(css(".Image").exists)` I want to create a loop till this css(.Image) is loading. Because once the URL is hitting at that time this CSS doesn't appear and it takes time to load and i want to calculate that time only.
@sandeeplal4810
@sandeeplal4810 2 года назад
@naveen why is there 8 requests in this and not 6? We've looped the 3 methods twice no?
@anonymous-vr5qn
@anonymous-vr5qn 3 года назад
can u please explain how to add a JSON path in my code package simulations? for seeing response body val scn = scenario(scenarioName = "Dashboard statistics") .exec(http(requestName = "Dashboard stat") .post(url = "/api/mobileDealerDashboard/statistics") .body(RawFileBody(filePath = "./src/test/resources/body/Input.json")).asJson .header(name = "Content-Type", value = "application/json") .check(status is 200)) setUp(scn.inject(atOnceUsers(users = 1))).protocols(httpConf) }
@yashb.pandhare5772
@yashb.pandhare5772 Год назад
How to deal with memory leakage?
@iammehuljain9208
@iammehuljain9208 3 года назад
package simulations import io.gatling.core.scenario.Simulation; import io.gatling.core.Predef._; import io.gatling.http.Predef._; import io.gatling.core.structure._; class LoopRequest extends Simulation { val httpConfg = http.baseUrl(url = "reqres.in") .header(name = "Content-Type",value = "application/json") def getAllUsersRequest(): ChainBuilder = { repeat(2){ exec(http("Get All User Details of Page 2") .get("/api/users?page=2") .check(status.in(200 to 210))) } } def getSingleUserRequest(): ChainBuilder = { repeat(2){ exec(http("Get Single User Detail") .get("/api/user/2") .check(status.in(200 to 210))) } } def addUserPostCall(): ChainBuilder = { repeat(2){ exec(http("Create New User") .post("/api/users") .body(RawFileBody("./src/test/resources/Bodies/Adduser.json")).asJson .check(status.in(200 to 210))) } } val scn = scenario("User Testing") .exec(getAllUsersRequest()) .pause(3) .exec(getSingleUserRequest()) .pause(3) .exec(addUserPostCall()) .pause(3) setUp(scn.inject(atOnceUsers(5))).protocols(httpConfg) } According to Above Script there should be total 6 api calls but its only 4 in Resport. ( 1 get all user, 1 get single user and 2 post calls) this is happnening every time both get calls are being called only one time but post is calling the number of time given in repeat function Why? > t < 800 ms 2 ( 50%) > 800 ms < t < 1200 ms 1 ( 25%) > t > 1200 ms 1 ( 25%) > failed 0 ( 0%)
@travelvlogs9050
@travelvlogs9050 Год назад
Yes I m getting the same
@amitagrawal4494
@amitagrawal4494 Год назад
Yes I am getting the same
Далее
#5 - POST API call in #Gatling with JSON Payload
19:09
Inside Out 2: BABY JOY VS SHIN SONIC 4
00:16
Просмотров 3,7 млн
Brilliant Budget-Friendly Tips for Car Painting!
00:28
Postman Api Testing Tutorial for beginners
16:45
Просмотров 37 тыс.
Loop Statement in Java and Usage in Selenium Webdriver
13:36
Parallel HTTP requests using requests_futures
14:39
Просмотров 17 тыс.
Inside Out 2: BABY JOY VS SHIN SONIC 4
00:16
Просмотров 3,7 млн