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