Hello,
I need to filter specific domain requests in my scenario. I have tried the HAR file-based recording and added the DenyList (like “.**\fonts. example.com.*\”) . On HttpProtocolBuilder I could see an entry for the exclusion in the inferHtmlResources. still while running the scenario, hits are going to the example.com domain. how do exclude specific requests based on domain name or pattern?
In the example provided, I tried to enter a single star but it is not showing up on the post so added an escape pattern with one more “*”.
Thanks for sharing the details, I have changed the pattern and tried it on the Java Regular Expression Tester it is matching with the absolute request URL. but still, request are hitting other domains on the ScenarioBuilder. anything I am missing?
I have used the HAR Converter as Recorder mode to create the Gatling simulation class, my requirement is to allow the request only to the domain 123.com and deny the request to the example.com domain. I tried to add a pattern ( inferHtmlResources(DenyList(“.example.”)) ) to the HttpProtocolBuilder. While running the scenario request are hitting both the 123.com and example.com domains.
Thanks for your response, I have removed the example domains get() inside the resources. now only baseurl requests are present still I could see requests to other domains. In my case it is retrieving the other domain URL from the base URL response
So you must prepare better pattern for DenyList()
Example → Case0012DenySomeResourcesSimulation
or
You can toresign from using inferHtmlResources and make own .resources() with resources what you want