How to make a certain API be called continuously

Hi, I have a scenario which I need to have an API to be called continuously, assume that my V.user will need 6 seconds to complete a workflow:

exec(
    API1
    API2 //this API will need to be called every 100 milliseconds until last API(n) is called
    API3 
    ...
)

Is there a way/function in Gatling support this feature? TYIA :smiley:

You canโ€™t have this kind of background task.
Instead, you can wrap your API calls into a loop and triggers the desired requests based on some condition (doIf, switch, etc).

1 Like

Iโ€™m not sure if I understood you correctly but I think that this is possible.
In code where I try to create solution for token refresh, you can see code that is checking if itโ€™s time for refresh token in loop (your background task) but main code doing own work.
Check this simulation:

Thank @slandelle , maybe I will try to persuade my colleague with your approach. :smiley:
@GeMi the task is kinda rush now so I will look into your approach later on, thank you for suggesting me. :smiling_face_with_three_hearts:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.