Access token in Selenium

Viewed 4728

is there some way to pass access token to Selenium tests, so that I dont have to use login page (I can not do that, because of the company policy).

I get the access token based on client id and client secret.

Thank you

1 Answers

In request API, you can put access token in headers to access resource, but in browser, you need put authentication info in cookies.

So, you can bypass the login step if you instantiate browser instance with cookies that contains authenticated session.

This link may help you https://www.swtestacademy.com/bypass-login-in-selenium-webdriver/

Related