Earl Mascetti
Earl Mascetti

Reputation: 1336

Selenium no longer works in R

Good evening, I write this question because I have a problem with my Rselenium. I use selenium with R every day, but since yesterday it has stopped working. My code is:

> library(RSelenium)
driver <- rsDriver(remoteServerAddr = "localhost", port=4445L, browser=c("firefox"), version = "latest")

The error message is:

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"

Selenium message:Unable to create session from {
  "desiredCapabilities": {
    "browserName": "firefox",
    "javascriptEnabled": true,
    "nativeEvents": true,
    "version": "",
    "platform": "ANY"
  },
  "capabilities": {
    "firstMatch": [
      {
        "browserName": "firefox"
      }
    ]
  }
}
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'PC3', ip: '192.168.1.151', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_221'
Driver info: driver.version: unknown

Could not open firefox browser.
Client error message:
     Summary: SessionNotCreatedException
     Detail: A new session could not be created.
     Further Details: run errorDetails method
Check server log for further details.

The real problem is that before yestarday the script worked.

The versions about the tools are:

Java is 1.8.0_221-b11

RStudio is 1.2.1335

Firefox is 69.0(64bit)

Windows 10 Pro 64bit

I didn't change my code. I don't know what happened?

Thank you so much in advance for any tipy of help.

Francesco

Upvotes: 4

Views: 637

Answers (1)

Peter.k
Peter.k

Reputation: 1548

I think there's no good help on web but I got exactly the same error code and found it works with this code:

require(RSelenium)

ff64 = "c:/PROGRAMS/Firefox/FirefoxPortable/App/Firefox64/firefox.exe"
pr64 <- list(`moz:firefoxOptions` = list(binary = ff64), pageLoadStrategy = 'none')

rs <- rsDriver(browser = "firefox", port = 4567L, extraCapabilities = c(ff64, pr64))
rd <- rs[['client']]

Now it opens with rd$open()

Just pointed the physical path to the application I'd like to run (in my case some other FF was invoked). Tested only with FF on 64-bit Win-7. Hope this helps.

Upvotes: 1

Related Questions