Generate a captcha token in the pre-request script

My question:
Is it possible to access browser APIs in the pre-request script?

My first pass at this is pretty much a hard no. We are protecting some of our public endpoints with a reCaptcha v3 and I was thinking it’d be neat to have a pre-request script generate a token for me automatically. Alas, the reCaptcha requires browser APIs like window and createElement().

I’ve already tried:
Mocking some browser APIs in the pre-request script but this seems like a very cumbersome route to go down. I am thinking it would need to be more like an update to the pre-request script runner itself to provide access to Browser APIs

1 Like