running Rselenium with rsDriver

2019-03-02 11:20发布

问题:

I'm trying to run RSelenium using the WDMAN package.

library(RSelenium)
library(wdman)
rd <-rsDriver(verbose =TRUE, browser = 'phantomjs')

This gives me an error:

[1] "Connecting to remote server"

Selenium message:org.openqa.selenium.os.CommandLine.find(Ljava/lang/String;)Ljava/lang/String;

Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: java.lang.NoSuchMethodError
     Further Details: run errorDetails method

I'm running LinuxMint 18.1.

If I run the server with the following it works:

library(RSelenium)
library(wdman)
selServ <- wdman::selenium(verbose = FALSE)

eCap <- list(phantomjs.page.settings.userAgent 
             = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0")

remDr <- remoteDriver(remoteServerAddr = "localhost" 
                      , port = 4444L
                      , browserName = "phantomjs"
                      , extraCapabilities = eCap
)

remDr$open()

I'd rather use rsDriver as it checks for updates. Why is this failing?

回答1:

This seems to be an issue with the latest version of selenium server (3.1.0). If you try the previous version the error doesn't appear:

rd <-rsDriver(verbose =TRUE, browser = 'phantomjs', version = "3.0.1")

> rd
$client
  browserName                                   id
1   phantomjs 7775b5b8-25de-4699-a171-7fd58c5c5a2a

$server
Process Handle
command   : /tmp/RtmptPZSvk/file2e132997bdf7.sh 
system id : 12240
state     : running

UPDATE:

This is now fixed as of Selenium Server version 3.2.0



标签: r rselenium