Different requests content and count between gatling and web

Yesterday, I found some issue and I am not sure is this problem on my site or not. I saw in fiddler different request counts and content if I run gatling script. Below are three screenshots from Fiddler when I user browser:

This traffic I saved as HAR file and converted for gatling. When I ran this simulation I see

What is the cause of this situation? I want to debug my simulations via fiddler (for example to see request which I need to change to handle all tokens). I am using Gatling 3.2.1

bug (604 KB)

normalConnect.saz (51.4 KB)

Could you please provide a SMALL har file and explain the discrepancy?

Are you really sure you use Gatling 3.2.1?
Your missing request issue looks like https://github.com/gatling/gatling/issues/3786 to me. It’s fixed in 3.2.1 and I do have the 2 requests (OPTION and GET) on my side.

Regarding Authorization: Bearer header, on contrary to Set-Cookie, there’s no way for a user-agent to figure out how to store it and when to send it back to the server. This is purely js client-side application logic and for you to reimplement in your Gatling tests (use a check to capture it).

Yes, I downloaded it today morning but it’s strange, I create new simmulation from HAR and I have two requests to /api/endpoint. But in different order

Regarding Authorization - I tried this solution: https://gist.github.com/alanphil/52d03338ba85c9ee0bd894b73ee3f999 But I’ve got error “Failed to build request: No attribute named ‘tokenname’ is defined in Gatling script” and I’m not sure what $…token is in .check(jsonPath("$…token").exists.saveAs(“authToken”))

W dniu poniedziałek, 14 października 2019 08:07:01 UTC+2 użytkownik Jakub Obrocki napisał:

Ok I think I resolve it, I found what JSONPath is, and change following lines

val scn = scenario(“login2”)
.formParam(“username”, “yelari@malboxe.com”)
.formParam(“password”, “Zaq1@wsx”)
.formParam(“grant_type”, “password”)
.check(jsonPath("$…access_token").exists.saveAs(“authToken”)) //new line

and on both requests with bearer

.get(uri1 + “/negotiate?clientProtocol=1.5&Authorization=Bearer%20${authToken}&connectionData=%5B%7B%22name%22%3A%22livechat%22%7D%5D”)

.get(uri1 + “/start?transport=serverSentEvents&clientProtocol=1.5&Authorization=Bearer%20${authToken}&connectionToken=bwseIuB%2FMBJVIlZSK2mDKkOPEWGIA%2FMGRTXjghZ1rNTRfXmu1AXlqrCeXHzIoKRojJ0D0%2BPKON0JhPtTbWsRXe%2FhZcn6mdF3pcE88iheLcXkKk7tqseuD4sxKDKzJ%2Fd%2BbZGQsejtiHHoV5oj5UTAFQ%3D%3D&connectionData=%5B%7B%22name%22%3A%22livechat%22%7D%5D”)

(on second I need to find connectionToken) but now it looks like it login me properly, thank you very much, it’s time to rule the world :slight_smile:

W dniu poniedziałek, 14 października 2019 08:07:01 UTC+2 użytkownik Jakub Obrocki napisał: