ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
344 stars 81 forks source link

Error in is(classDef, "refClassRepresentation") : could not find function "is" #201

Closed imtheu closed 5 years ago

imtheu commented 5 years ago

Operating System

Ubuntu 18.04

Selenium Server version

Docker: selenium/standalone-chrome-debug:latest and selenium/standalone-chrome:latest (I think it is 3.141.59)

Browser version

chrome 72.0.3626.119 (64-bit)

Other driver version

chromedriver 2.41.578700

Actual behaviour

Error in is(classDef, "refClassRepresentation") : could not find function "is" Calls: \<Anonymous> -> \<Anonymous> Execution stopped

Steps to reproduce the behaviour

library(RSelenium)
library(devtools)
remDr <- remoteDriver(
    remoteServerAddr = "localhost",
    port = 4445L,
    browser = "chrome"
)
remDr$open(silent = TRUE)
remDr$navigate("http://www.google.com/ncr")
remDr$getTitle()
webElem <- remDr$findElement(using = "name", value = "q")
imtheu commented 5 years ago

I found out. The problem is that I'm running through the Linux terminal with Rscript. $ Rscript File.R

By default, Rscript does not load the methods package.

The default for ‘Rscript’ omits ‘methods’ as it takes about 60% of the startup time.

-- help(Rscript)

So, to run it is necessary to specify the package when executing: $ Rscript --default-packages=methods File.R

Or run with Rstudio. :smile: