Latest version of RSelenium and Firefox

我与影子孤独终老i 提交于 2019-12-12 17:06:25

问题


When I try to open the RSelenium I receive this error

[1] "Connecting to remote server"
Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: org.openqa.selenium.firefox.NotConnectedException

The version of Firefox I have is

Firefox version: 480b10

According to this I tried to update the server version

library("RSelenium")
startServer()
unlink(system.file("bin", package = "RSelenium"), recursive = T)
checkForServer(update = TRUE)
remDr <- remoteDriver()
Sys.sleep(5)
remDr$open()
Sys.sleep(5)

but the problem still exist. Does anyone face this problem? Any possible solution?


回答1:


From Firefox 48 on-wards the gecko driver/ marionette will be needed to run Firefox with Selenium.

If you have Firefox 48 you can run the gecko driver as follows:

Refer to the guidelines

  1. https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
  2. Download the relevant gecko driver from https://github.com/mozilla/geckodriver/releases
  3. Add it to your PATH or refer to the location when starting binary (see below)
# get beta selenium standalone

RSelenium::checkForServer(beta = TRUE)
# assume gecko driver is not in our path (assume windows and we downloaded to docs folder)
# if the driver is in your PATH the javaargs call is not needed
selServ <- RSelenium::startServer(javaargs = c("-Dwebdriver.gecko.driver=\"C:/Users/john/Documents/geckodriver.exe\""))
remDr <- remoteDriver(extraCapabilities = list(marionette = TRUE))
remDr$open()
....
....
remDr$close()
selServ$stop()  

The above currently requires the dev version of RSelenium. Alternatively you can download the Selenium binary from http://selenium-release.storage.googleapis.com/index.html . Pick the 3.0 beta 2 binary to currently run with Firefox 48. Run the binary

java -Dwebdriver.gecko.driver=C:/Users/john/Documents/geckodriver.exe -jar selenium-server-standalone-3.0.0-beta2.jar


来源:https://stackoverflow.com/questions/38812342/latest-version-of-rselenium-and-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!