I am trying to test the loading time of a home page. The sequence of HTTP requests made by browser when loading the home page is like A -> B -> [C, D, E]
Which is to say
- B executes after A's response is received and
- C, D, E starts concurrently after B's response is received.
I tried the below approach to simulate this:
Approach 1
Have one scenario each for A, B, C, D, E
.
All of the scenarios are configured with say 50 users. I tried this:
A.inject().andThen(B.inject.andThen(C.inject(), D.inject(), E.inject()))
The problem with this is that, B starts only after all users of A has stopped. This does not simulate the home page loading accurately because I expect a user who has finished A to start with B without waiting for other users.
Approach 2
I created a single scenario with all the http requests.
exec(A).exec(B).exec(C).exec(D).exec(E)
This would mean that for example, D executes only after C's response is received. This is not right.
What is the best way to solve the problem?