How to build a dynamic css/js request in Gatling

I have some dynamic resources like css or js file used in a scenario, so how can i build accurate requests including the dynamic resources?

I have been confused such a long time and have no idea how to get a full accurate scenario based on all the requests, so could anybody give me some suggestions?

Gatling has an “inferHtmlResources” feature, see Gatling - HTTP Protocol

However, it only works for resources embedded in the HTML response payloads. It won’t work for resources that are triggered by JavaScript.

Now:

  • the goal of load testing is to verify the behavior of your server, not page load time in the browser
  • static resources are best served by cache/CDNs, not your application server

I personally consider including static resources in load tests a bad practice.

Thank you, slandelle, it really helps me.