Reading Session Storage Access Token from UI

We don’t have any exposed APIs that will fetch bearer token for Authentication that can be send as an header for further API calls. The only way is to logged-in to UI of our WebSite and read token from Application -= Session Storage - Token. Then send that token as an header for further API calls
Is such kind of testing possible using K6 ?

Hi @vishal.lanke

It seems like we’re in luck. We recently introduced a browser-testing experimental module to k6 :tada:

I can’t guarantee 100% it will be able to do what you’re looking for, but I would recommend looking into it, as it sounds like exactly what you’re looking for :handshake:

Let me know if that works out for you, and if I can be of further help :bowing_man:

@oleiade , From the official docs, we can work with only cookies and not session storage yet.

I need to add session storage key value pair, and then need to launch my URL. Is that something similar to sessionStorage Playwright in K6?

@vishal.lanke , tried with any possible solutions?

Hi @Renusri

I believe session storage is not yet on the radar of the team developing the browser module. If you have the capacity, we’d really appreciate if you could take the time to open a feature request to the browser module’s repository: here

Thank you! :bow:

1 Like

Hello, Thank you for confirming the same. However, we found a work-around for the same. May be if needed will get back.

If you have the bandwidth, it could be worth expanding on your workaround here, in case someone with the same requirements stumbles on this post +1: We would very much appreciate it :bowing_man:

1 Like