Error using --user-data-dir

90 views
Skip to first unread message

Pablo Romero

unread,
Jun 6, 2023, 11:29:11 AM6/6/23
to ChromeDriver Users
Hello,

I am having problem when using --user-data-dir argument. I have the following options:

ChromeOptions ops = new ChromeOptions();
ops.addArguments("--no-sandbox");
ops.addArguments("--user-data-dir=" + this.userDataDir);
ops.addArguments("--profile-directory=Default");
ops.addArguments("--disable-extensions");
ops.addArguments("--remote-debugging-port=9515");

//Create RemoteWebDriver instance and connect to the Appium server
System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, "C:\\WebDrivers\\chromedriver.exe");

ChromeDriverService service = ChromeDriverService.createDefaultService();
driver = new ChromeDriver(service, ops);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
driver.manage().window().maximize();
driver.get(url);

However, after the browser is opened with the correct profile, I got an error in the console

[1686064650.669][DEBUG]: DevTools HTTP Request: http://localhost:9515/json/version

[1686064653.019][DEBUG]: DevTools HTTP Request failed

[1686064653.025][INFO]: [b8809a8ad7151c6473ff2a0b105f610a] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited normally.

(chrome not reachable)

(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)


Does anyone known what is happend? If I remove user data argument works fine, but a I need to skip a login so I need to use the user-dir. This is driving me crazy.


Thanks in advance.

Reply all
Reply to author
Forward
0 new messages