Issue with getChromeProfile and --headless - RSelenium

207 views
Skip to first unread message

moreno....@carloalberto.org

unread,
Jul 2, 2018, 2:46:11 PM7/2/18
to ChromeDriver Users
Daar all,

I'm struggling with a problem which might be related to Chromedriver. 
When I try to open a remoteDriver from RSelenium with the --user-data-dir/--profile-directory, together with the --headless option, Chromedriver apparently freezes. This happens only on Windows and MacOs (it seems to work with Ubuntu). I use Chrome 67. Below you can find the code to replicate the issue:

################################################################
library(RSelenium) #===== user_path <- "C:/Users/Moreno/Desktop/Chrome_profile"
cDrv <- wdman::chrome(version = "2.40", verbose = FALSE, check = TRUE) #===== Include options eCaps <- RSelenium::getChromeProfile(dataDir = user_path, profileDir = "Profile 1") eCaps$chromeOptions$args[[3]] <- "--headless" eCaps$chromeOptions$args[[4]] <- "--disable-notifications" #===== Initialize driver remDr <- RSelenium::remoteDriver(remoteServerAddr = "localhost", browserName = "chrome", port = 4567L, extraCapabilities = eCaps) #===== Launch driver remDr$open()

################################################################

If I remove alternatively the ""--headless" and the "--user-data-dir/--profile-directory" options, everything works perfectly, but if I combine the options, in Windows and MacOs, after "remDr$open()" I obtain the following:

________________________________________________________________
[1] "Connecting to remote server" Selenium message:unknown error: unable to discover open pages (Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.17134 x86_64) Error: Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. Further Details: run errorDetails method
________________________________________________________________

I tried with other specifications of the options' combination, but nothing worked. It really seems that the combination just makes Chromedriver unusable, however, I'm really new of RSelenium/Chromedriver, so maybe I'm missing something.

Thank you very much in advance!

Moreno

John Chen

unread,
Jul 2, 2018, 5:29:28 PM7/2/18
to moreno....@carloalberto.org, ChromeDriver Users
Hi Moreno,

Thanks for reporting this issue to us.

On Windows, headless Chrome work properly only if user-data-dir uses \ instead of / as path separator. I filed an issue (https://crbug.com/859676) to track this. In the meantime, you can work around this issue by replacing / with \ in your path.

I wasn't able to repro this issue on Mac, though I don't have access to RSelenium, and used Python instead. If you can provide ChromeDriver verbose log then I can take another look.

Thanks,
John

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages