1

I'm trying to get my first RSelenium package to a point where I can learn how to use it, but I'm getting a status 125 error when I run this code:

shell('docker run -d -p 4445:4444 selenium/standalone-firefox')
remDr$open()

[1] "Connecting to remote server" Error in checkError(res) : Undefined error in httr call. httr output: Failed to connect to 192.168.99.100 port 4445: Connection refused

Background: I'm running a 64 bit version of Windows 10 Home edition I have Oracle VM running the default machine as windows 7 64 bit, it is currently active. I have Docker Toolbox, a session is also active and running:

docker-machine ls

shows me that the container is connected, recognises the docker version v18.03.0-ce and is active.

I downloaded " selenium-server-standalone-3.9.1.jar " In Docker Toolbox I ran this code

docker pull selenium/standalone-firefox:2.53.0

Docker pulled to completion.

In the cmd, in ran

java -jar  selenium-server-standalone-3.9.1.jar

which returned 'Selenium Server is up and running on port 4444' I then opened a session of R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree", Platform: x86_64-w64-mingw32/x64 (64-bit)

and tried to run this code:

library(RSelenium)
shell('docker run -d -p 4445:4444 selenium/standalone-firefox')

which gives me the 125 error.

I should note that I haven't restarted the computer since reinstalling Oracle VM

Sorry for drowning you in details, but at this point the number of possible points of failure is a little overwhelming and I want to be thorough.

curly
  • 43
  • 1
  • 7
  • A possible source of the problem is that I ran `code` docker pull selenium/standalone-firefox:2.53.0 on the docker quickstart window, when I tried to run docker in the VM it started to pull. I'm thinking that maybe I wassupposed to pull the image in the vm window, not the docker window – curly Mar 30 '18 at 23:03
  • Having run through the docker set-up in the VM, upto 'hello world', I tried connecting through R using this code: remDr <- remoteDriver(remoteServerAddr = "192.168.99.100", port=4444) > remDr$open() It now gives a different error message. SO, progress...? – curly Mar 30 '18 at 23:53
  • The error code is specifically " [1] "Connecting to remote server" Selenium message:address not available Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z' System info: host: '9ea9dbbe6bc0', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.89-boot2docker', java.version: '1.8.0_151' Driver info: driver.version: unknown remote stacktrace: Erreur : Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. Further Details: run errorDetails method " – curly Mar 30 '18 at 23:53
  • refer https://stackoverflow.com/questions/42468831/how-to-set-up-rselenium-for-r https://stackoverflow.com/questions/45395849/cant-execute-rsdriver-connection-refused – Nad Pat Sep 16 '21 at 06:37

1 Answers1

0

Did you follow the correct order of the commands?

  1. Run Docker
  2. shell('docker run -d -p 4445:4444 selenium/standalone-firefox:2.53.0')
  3. rem_dr <- remoteDriver(remoteServerAddr = "localhost", port = 4445L, browserName = "firefox")
  4. rem_dr$open(silent = TRUE)
  5. url = "https://www.google.com/"
  6. rem_dr$navigate(url) to open the URL
  7. rem_dr$screenshot(display = T, useViewer = TRUE) to get a screenshot of the URL you opened with FF in the viewer.

If that does not work: Have you tried restarting docker? Or run the docker run -d -p 4445:4444 selenium/standalone-firefox:2.53.0 as admin from the shell? Hope that helps future users!

ToWii
  • 590
  • 5
  • 8