Hi,
I the application which I am testing has Rich UI (JavaScript based) and bunch of back-end RESTful services which are “feeding” the UI with content.
In order to get rendered, the UI (running in a browser) is doing simultaneous / asynchronous requests to the various back-end endpoints and retrieving the information.
I am trying to simulate this behaviour, but I am not quite sure which is the best way to do it.
The two options which I have in mind are:
- simulating the parallel calls as if they are real web page resources (i.e. using http’s resources(…) method):
val myPage = exec(http("My Page")
.get("https://my.page.com/home")
.header("Accept", "application/xml,application/xhtml+xml")
.resources(
// apples resource
http("Apples - OPTIONS").options("https://my.page.com/apples").check(status.is(200)),
http("Apples - GET").get("https://my.page.com/apples").check(status.is(200)),
Can anybody reply to my question please? Or if something is not clear enough, please let me know
петък, 27 февруари 2015 г., 0:18:12 UTC, Nikolay Vasilev написа:
Hi,
“Create group of requests to model process or requests in a same page.” IMO isn’t specific enough to understand well this Gatling functionality.
Well, if the documentation doesn’t state that a feature does something, don’t you feel safe to assume that it indeed doesn’t? Groups have nothing to do with executing requests in parallel. It just computes stats.
Async HTTP requests = resources. Period.
The tricky part is that in order the users to access this page, they should be authenticated (i.e. have some session cookie) and here I am facing another problem (which is related to my group(…)-question) - how to simulate these parallel calls for an authenticated user?
I really don’t get your point. Virtual users run concurrently.
PS: Scenarios are not virtual users. A scenario is a workflow. Virtual users are the messages that go down the workflow.
Thank you very much Stéphane. Sorry that I didn’t reply the last week.
Now it makes sense.
Do you think there is a way to run multiple calls (e.g. OPTIONS + GET or POST) as resources requests and group their statistics?
Thanks,
Nikolay
вторник, 3 март 2015 г., 10:29:16 UTC, Stéphane Landelle написа:
Yes, you can. Try it out. But know that .resources() only takes http() requests, it does not take chains. So you can’t control the timing, or the parallelism. Think it through before you write your scenario like that, because it may not be what your application actually does.
Thanks John (and apologies for the late reply)
Hi, I need an advice, how to organize test structure.
I have a bunch of endpoints, which are mostly called in parallel, but also could be called individually - it depends on scenario. For example I have the following individual actions:
`
val showAllProperties= exec(http(“req1”)
.post("/req1")
…)
val showAllPositions= exec(http(“req2”)
.post("/req2")
…)
val showConcretePosition= exec(http(“req3”)
.post("/req3")
…)
`
But I also have another actions, which are partly consists of the same requests, lets say:
`
val openHomePage= exec(http(“req1”)
.post("/req1")
…
.resources(
http(“req2)
.post(”/req2")
.body
…