Automated testing of fire and forget HTTP requests

What approaches have people seen for automating the validation/checking of fire and forget outgoing HTTP requests?

Sceanario:
We have a web app that sends HTTP Get requests to an analytics service to record how a user is interacting with the product.
I want to check these outgoing HTTP request have certain values in their path.
Other aspects of the product are tested using WDIO with Saucelabs.
NB I have the ability to configure the app to send these requests to a different host.

The approaches I’ve been able to find so far fall into the categories or either interceptors or mocks/spies.

3 Likes

I’ve not personally worked with fire and forget calls, but my thoughts would be to request interception. You’d achieve this with a proxy tool. Fiddler used to be my tool of choice, but I also really like BURP Suite these days. (BURP is aimed more at security testing but it would allow you to intercept the calls).

I would imagine there is a way to use a mock server to intercept and log outgoing HTTP requests too. Something like Wire Mock maybe?

1 Like

Thanks James.
I’ve considered Wiremock, but I’ve a feeling that would have to run on the machine running the browser which in this case is SauceLabs virtual boxes.

Anthony

1 Like

I have done something similar using Cypress. There seems to be a 3rd party package for WDIO https://webdriver.io/de/docs/wdio-intercept-service/

1 Like

If the client code triggers the request then you can likely use WDIO Intercept Service - wdio-intercept-service