Google-chrome: how to share a profile between manual browser UI and selenium activity

41 views
Skip to first unread message

dean

unread,
Jul 24, 2018, 10:13:48 AM7/24/18
to Selenium Users

for sites that have difficult logins (like reCapture), I'm trying to manually login then use selenium to automate the rest of activity. I'm using python (Debian)

  1. 1. via chrome browser UI, I manually created a user profile.

  2. 2. Then I manually login using that profile. 

  3. 3. I then load the profile using selenium by,


options = webdriver.ChromeOptions()

options.add_argument("--user-data-dir=/home/user/.config/google-chrome/profile1");


I understand a new browser instance is launched, but history, cookies and settings should remain when associated to a profile. specific to my need, the profile is a bridge between doing things automated with selenium and manually via a browser UI. 


I was able to test when using a profile and logging-in using selenium that my previous login is recognized, but the previous login is not recognized by selenium if i had logged in manually. can i achieve my aim by loading the profile in a different way or different file like from the /tmp folder?

Serguei Kouzmine

unread,
Jul 27, 2018, 9:38:26 PM7/27/18
to Selenium Users
Dean 

You achieve the desired via saving and loading cookies, not via profiles

dean

unread,
Jul 30, 2018, 10:29:11 AM7/30/18
to Selenium Users
what's the benefit of using profiles? I thought the profile would retain the cookies and all other settings to the browser

is it possible to load the same cookies between doing things manually and automated using selenium?

whoever replies, much appreciated if you provide code examples or a deeper explanation
Reply all
Reply to author
Forward
0 new messages