Answer the question
In order to leave comments, you need to log in
How to use authorization in autotests?
All good.
Who knows if I can use the authorization on the site that was performed on the site earlier when running autotests?
For example, there is a task to write an autotest for ok.ru. Logged into the site, everything is chin-chin. But when the autotest starts, there is no authorization, you need to log in, etc.
Is it possible to somehow use an already authorized session when starting an autotest?
Answer the question
In order to leave comments, you need to log in
It would be best to look in the direction of the cookie dump.
https://stackoverflow.com/questions/15058462/how-t...
To do this, you need to launch the browser with the profile parameter. On the first run, selenium will create a folder where the cookies will be stored, on subsequent runs they will be picked up
options = webdriver.ChromeOptions()
options.add_argument(r"user-data-dir=C:\profile_folder")
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe", chrome_options=options)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question