Selenium Loads Chrome Profile without cookies or saved passwords

Viewed 34

I use Selenium in java and I created a custom Chrome Profile to avoid logging in every time. Custom profile loads and history is saved but cookie information is not saved. I have to log in again. Also saved passwords aren't available. When I close webdriver session and switch to this custom profile, the previous cookie also becomes unavailable. I'm using Fedora.

    options.addArguments("user-data-dir=/home/userName/.config/google-chrome/");
    options.addArguments("profile-directory=Profile 2");
    options.addArguments("--no-sandbox");
    options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});

Could this be due to a --no-sandbox flag? Selenium can't create a session without this flag.

I tried with Windows, it's working without a problem. With and without --no-sandbox flag. So I assume that it's not related to this flag. Also, I get an error on Linux, Chrome can't start without --no-sandbox flag (I installed Chrome via Software manager, then uninstall and installed using rpm and using DNF but nothing changes).

0 Answers
Related