Package: RSelenium 1.7.9

Jonathan Völkle

RSelenium: R Bindings for 'Selenium WebDriver'

Provides a set of R bindings for the 'Selenium 2.0 WebDriver' (see <https://www.selenium.dev/documentation/> for more information) using the 'JsonWireProtocol' (see <https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol> for more information). 'Selenium 2.0 WebDriver' allows driving a web browser natively as a user would either locally or on a remote machine using the Selenium server it marks a leap forward in terms of web browser automation. Selenium automates web browsers (commonly referred to as browsers). Using RSelenium you can automate browsers locally or remotely.

Authors:John Harrison [aut], Ju Yeong Kim [aut], Jonathan Völkle [aut, cre], Indranil Gayen [ctb]

RSelenium_1.7.9.tar.gz
RSelenium_1.7.9.zip(r-4.5)RSelenium_1.7.9.zip(r-4.4)RSelenium_1.7.9.zip(r-4.3)
RSelenium_1.7.9.tgz(r-4.5-any)RSelenium_1.7.9.tgz(r-4.4-any)RSelenium_1.7.9.tgz(r-4.3-any)
RSelenium_1.7.9.tar.gz(r-4.5-noble)RSelenium_1.7.9.tar.gz(r-4.4-noble)
RSelenium_1.7.9.tgz(r-4.4-emscripten)RSelenium_1.7.9.tgz(r-4.3-emscripten)
RSelenium.pdf |RSelenium.html
RSelenium/json (API)
NEWS

# Install 'RSelenium' in R:
install.packages('RSelenium', repos = c('https://packages.ropensci.org', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ropensci/rselenium/issues112 issues

Pkgdown site:https://docs.ropensci.org

On CRAN:RSelenium-1.7.9(2022-09-02)

Conda:r-rselenium-1.7.9(2025-03-25)

rseleniumseleniumwebdriver

13.38 score 344 stars 12 packages 1.9k scripts 10k downloads 5 mentions 8 exports 22 dependencies

Last updated 2 years agofrom:6071311243 (on master). Checks:3 OK, 6 NOTE. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 09 2025
R-4.5-winNOTEMar 09 2025
R-4.5-macNOTEMar 09 2025
R-4.5-linuxNOTEMar 09 2025
R-4.4-winNOTEMar 09 2025
R-4.4-macNOTEMar 09 2025
R-4.4-linuxNOTEMar 09 2025
R-4.3-winOKMar 09 2025
R-4.3-macOKMar 09 2025

Exports:errorHandlergetChromeProfilegetFirefoxProfilemakeFirefoxProfileremoteDriverrsDriverselKeyswebElement

Dependencies:askpassassertthatbinmanbitopscaToolsclicurlhttrjsonlitemimeopensslprocessxpsR6rappdirsRcpprlangsemversyswdmanxml2yaml

Driving OS/Browsers Local and Remote

Rendered fromsaucelabs.Rmdusingknitr::rmarkdownon Mar 09 2025.

Last update: 2022-09-01
Started: 2018-09-06

Internet Explorer

Rendered frominternetexplorer.Rmdusingknitr::rmarkdownon Mar 09 2025.

Last update: 2022-09-01
Started: 2018-11-14

Basics

Rendered frombasics.Rmdusingknitr::rmarkdownon Mar 09 2025.

Last update: 2022-09-01
Started: 2018-09-06

Docker

Rendered fromdocker.Rmdusingknitr::rmarkdownon Mar 09 2025.

Last update: 2022-09-01
Started: 2018-09-06

Citation

To cite package ‘RSelenium’ in publications use:

Harrison J, Kim J, Völkle J (2025). RSelenium: R Bindings for 'Selenium WebDriver'. R package version 1.7.9, https://github.com/ropensci/rselenium.

Corresponding BibTeX entry:

  @Manual{,
    title = {RSelenium: R Bindings for 'Selenium WebDriver'},
    author = {John Harrison and Ju Yeong Kim and Jonathan Völkle},
    year = {2025},
    note = {R package version 1.7.9},
    url = {https://github.com/ropensci/rselenium},
  }

Readme and manuals

RSelenium

This is a set of R Bindings for Selenium 2.0 Remote WebDriver, which you can download from http://selenium-release.storage.googleapis.com/index.html. This binding will not work with the 1.0 version of Selenium.

Install

To install RSelenium from CRAN, run:

install.packages("RSelenium")

To install the development version from GitHub, run:

# install.packages("remotes")
# remotes::install_github("ropensci/RSelenium")
install.packages("RSelenium", repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

To get started using RSelenium you can look at the introduction vignette located in /doc/basics.html once RSelenium is installed or run

vignette("basics", package = "RSelenium")

or the basic vignette can be viewed here.

There is a second vignette dealing with running RSelenium on different browsers/OS locally and remotely which can be viewed at Driving OS/Browsers Local and Remote.

Summary of Vignettes
  1. Basics
  2. Driving OS/Browsers Local and Remote
  3. Testing Shiny Apps
    • Consider using RStudio's shinytest package for testing Shiny apps.
  4. Headless Browsing
    • PhantomJS development is suspended until further notice.
    • Consider using RStudio's webdriver package.
  5. Docker
  6. Internet Explorer
    • Internet Explorer 11 has retired as of June 15, 2022.

Use Sauce Labs and BrowserStack Sauce LabsBrowserStack

Sauce Labs
user <- "rselenium0"
pass <- "*******************************"
port <- 80
ip <- paste0(user, ':', pass, "@ondemand.saucelabs.com")
browser <- "firefox"
version <- "25"
platform <- "OS X 10.9"
extraCapabilities <- list(
  name = "Test RSelenium",
  username = user,
  accessKey = pass
)

remDr <- remoteDriver$new(
  remoteServerAddr = ip,
  port = port,
  browserName = browser,
  version = version,
  platform = platform,
  extraCapabilities = extraCapabilities
)
BrowserStack
user <- "johnharrison" 
pass <- "*******************"
port <- 80
ip <- paste0(user, ':', pass, "@hub.browserstack.com")
extraCapabilities <- list(
  "browser" = "IE",
  "browser_version" = "7.0",
  "os" = "Windows",
  "os_version" = "XP",
  "browserstack.debug" = "true"
)

remDr <- remoteDriver$new(
  remoteServerAddr = ip,
  port = port,
  extraCapabilities = extraCapabilities
)

Related Work

  • chromote: An R implementation of the Chrome DevTools Protocol. It works with Chrome, Chromium, Opera, Vivaldi, and other browsers based on Chromium.
  • shinytest: For automated testing of Shiny applications, using a headless browser, driven through webdriver.
  • webdriver: A client for the 'WebDriver API'. It allows driving a (probably headless) web browser, and can be used to test web applications, including Shiny apps. In theory it works with any 'WebDriver' implementation, but it was only tested with 'PhantomJS'.
  • seleniumPipes: A lightweight implementation of the w3c webdriver specification. It has been built utilising xml2, httr and magrittr so provides an alternative for users who are familiar with piping.
  • rwebdriver: R bindings to the Webdriver API
  • rdom: Render and parse the DOM from R via phantomjs.

License

The RSelenium package is licensed under the AGPLv3. The help files are licensed under the creative commons attribution, non-commercial, share-alike license CC-NC-SA.

As a summary, the AGPLv3 license requires, attribution, include copyright and license in copies of the software, state changes if you modify the code, and disclose all source code. Details are in the COPYING file.


Help Manual

Help pageTopics
An R client for Selenium Remote WebdriverRSelenium-package RSelenium
CLASS errorHandlererrorHandler errorHandler-class
Get Chrome profile.getChromeProfile
Get Firefox profile.getFirefoxProfile
Make Firefox profile.makeFirefoxProfile
CLASS remoteDriverremoteDriver remoteDriver-class
Start a selenium server and browserrsDriver
Selenium key mappingsselKeys
CLASS webElementwebElement webElement-class