I'm a bit rusty on selenium, but iirc there should be some command line argument to select the profile on launch. You could try that, i remember there's a way to specify command line arguments from selenium
this post was submitted on 12 Mar 2024
3 points (100.0% liked)
Selenium Web Browser Automation
98 readers
1 users here now
Users forum for selenium browser testing. Do not advertise here.
founded 1 year ago
MODERATORS
If you mean the --user-data-dir
and --profile-directory
options then here's what happens:
- I'm supposed to check the user-data-dir path to parse by opening
chrome://version
- the data dir path can be parsed either with the profile directory or not; in my case the profile is named
Default
- when parsing the full path chrome opens in incognito mode and selenium throws a
selenium.common.exceptions.SessionNotCreatedException
- cutting the
Default
off from the data dir path and disabling the profile directory option ends up in profile selection window not having the previously visibleProfile 1
- I've tried deleting
Profile 1
, it didn't seem to do anything
edit: I misremembered the behavior when (not) parsing the full path to the default profile