Hi Nyx,
-
If your lucky the JWT is passed by a cookie in which case Get Cookie or Get Cookies will get you what you need.
-
another option if the JWT is passed as a http header then you will probably need to work with some javascript to extract it, Execute Javascript will be useful to do this.
Here is some Javascript that I modified from some examples I found regarding getting headers from a page, it basically triggers the browser to send a HTTP HEAD request for the current page and then extracts the headers from that HEAD request
var req = new XMLHttpRequest();
req.open('HEAD', document.location, false);
req.send(null);
var headrs = req.getAllResponseHeaders().split("\n");
- yet another option is to use the javascript functions for accessing the storage locations, i’ve never done this myself, but I found some documentation on it here JavaScript localStorage - GeeksforGeeks, combine that with Execute Javascript and you might be able to query that storage location directly
Hope this helps,
Dave.
1 Like
Thank you so much highly appreciated, i’ll get look into your suggestions @damies13
1 Like
Hello @damies13 I’ve found a library where you can easily get an item on the localStorage or sessionStorage
- https://marketsquare.github.io/robotframework-seleniumtestability/index.html?tag=plugin
- GitHub - MarketSquare/robotframework-seleniumtestability: Extension for SeleniumLibrary that provides manual and automatic waiting for asyncronous events like fetch, xhr, etc.
1 Like