I'm trying to start a server and browser using the below code but I get this error.
I looked over the internet and couldn't find anything which could help me out.
rD <- RSelenium::rsDriver(
port = 4444L,
browser = c("firefox"),
version = "latest",
...
)
remDr <- rD[['client']]
remDr$open(silent = TRUE)
Error:
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"
Could not open firefox browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4444: Connection refused
Check server log for further details.
Error in checkError(res) :
Undefined error in httr call. httr output: Failed to connect to localhost port 4444: Connection refused
In addition: Warning message:
In RSelenium::rsDriver(port = 4444L, browser = c("firefox"), version = "latest", :
Error in checkError(res) :
Undefined error in httr call. httr output: Failed to connect to localhost port 4444: Connection refused
>
Hii @HanOostdijk,
Thank you so much for replying. I'm using Ubuntu 18.04 and it didn't throw any error like that.
I literally just found the thing which was causing the issue.
RSelenium's rsDriver uses wdman::selenium() to start the server.
This was the output:
I tried running the same thing twice more and got the same outputs but with a small difference. It was the version of selenium which was different each time.
The 4th time I ran the same command to start the server and no download process shows up. Then I checked the log and found that the jar was corrupted.
Now, I downloaded the jar from the official website and placed inside that directory and it worked perfectly. One more thing was that I specified a version to use in order to avoid alpha releases.
It worked but still I couldn't understand why it's happening!