Reputation: 56
I want to speed up my Selenium tests and noticed that a lot of time is being spent on login procedure.
Login on web application is implemented via localStorage session token (probably OAuth 2.0). I know how to set it once a browser starts and login page loads:
localStorage.setItem(key, value)
It works great. But is it possible to make the browser to pick up custom localStorage using Selenium (Java).
Is it profile?
Upvotes: 2
Views: 2644
Reputation: 11
Well this works for me in python
driver.excute_script('javascript:localStorage.(funtion of localStorage)')
so I suppose well you can set up a validation token like I use for test, and of course I get my auth_token
from the database first, but it works like this
driver.excuteScript('javascript:localStorage.token="your validation token";');
should work
Upvotes: 1