Completing a webstore checkout

Hey all, new to gatling and trying to reproduce a scenario where a user checks out an item in a web store. Gatling will add items to my cart but fails to complete the process. I believe I’ve tracked the problem down to this bit of code on the checkout page:

Place Order

The relevant section in the recored script looks like this:

.exec(http(“request_195”)
.post("/checkout/onepage/saveOrder/")
.headers(headers_162)
.param(""“payment[method]”"", “”“checkmo”"")
.pause(431 milliseconds)
.exec(http(“request_196”)
.get("/checkout/onepage/success/")
.headers(headers_1)
.pause(1)

Any way to send the save event or should I just settle with filling my cart without actually completing the checkout process?

Hi,

Could you explain what doesn’t work exactly?

Gatling is not a browser, so it can’t run javascript. It works at protocol/network level.
The browser should have recorded the HTTP request issued by review.save(); + submit.

I would have thought that the “/checkout/onepage/saveOrder/” POST was actually that.

Please elaborate.

Cheers,

Stéphane

Hi Stephane,

The product are being loaded in the cart but not being checked out for some reason. I’ve gone through the process step by step and Gatling is sending correct parameter settings for various check boxes along the way, but the final step seems suspect due to an unnecessary

.param(""“payment[method]”"", “”“checkmo”"")

that was already set several steps before in the process. And you are correct, the post is supposed to submit the form. I’m really not sure what the problem could be.

Best,

Could you uncomment the logger in logback.xml so that we can see what’s going on the wire exactly, please?
I suspect an encoding issue with the square brackets in payment[method].

This is strange… I turned on the logger and ran the script again and this time it completed the process without a hitch - I just bought myself a whole bunch of ladies shoes :slight_smile:

Now I’m thinking it may have had to do with network problems where the process was breaking because various steps were failing (and they’re all necessary to complete the checkout.

Anyway, thanks for your help Stephane!

Best,
Vlad

Glad to hear.
Feel free to contact again if you run into new problems.

Cheers,

Stéphan