I have been using selenium-wire to intercept and work with requests and responses headers, but now in 2024 selenium-wire is no longer maintained so I wonder what would be the alternative from now on.
At some point in time selenium maintainers mentioned that this isn't the option for the core library so obviously some other way is needed (unless something has changed dramatically in this area since then).
There seems to be no straightforward way to do it. Initially I thought that I can utilize execute_script function somehow, but, as I have learnt, there is no API in the browser for getting access to already issued requests.
The scenario I am trying to put it in is as follows:
- Perform oauth via browser with user actions against system under test
- Capture access_token issued during step 1
- Use this token against other endpoints available in identity server (eg. session, revoke, introspect) and for direct api calls to backends.
Apart from that having access to underlying properties of the requests seems like a very valid use case. I have checked it in competing frameworks and it looks like some of them at least offer such possibility (like cypress with intercept
function).
Is there some smart way to make straightforward workaround for this in selenium or it will be less hassle to move to another framework?