CRAN version Travis build status Appveyor build status Coverage
Build Status AppVeyor Build Status codecov

Introduction

wdman (Webdriver Manager) is an R package that allows the user to manage the downloading/running of third party binaries relating to the webdriver/selenium projects. The package was inspired by a similar node package webdriver-manager.

The checking/downloading of binaries is handled by the binman package, and the running of the binaries as processes is handled by the subprocess package.

The wdman package currently manages the following binaries:

Associated with the above are five functions to download/manage the binaries:

Installation

You can install wdman from GitHub with:

The package can also be installed from CRAN:

Example

As an example, we show how one would run the Selenuium standalone binary as a process:

Running the Selenium binary

The binary takes a port argument which defaults to port = 4567L. There are a number of optional arguments to use a particular version of the binaries related to browsers selenium may control. By default, the selenium function will look to use the latest version of each.

The selenium function returns a list of functions and a handle representing the running process.

The returned output, error and log functions give access to the stdout/stderr pipes and the cumulative stdout/stderr messages rerspectively.

selServ$log()

## $stderr
##  [1] "10:28:57.720 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'"                                                                                          
##  [2] "10:28:57.721 INFO - Launching a standalone Selenium Server"                                                                                                              
##  [3] "2017-01-17 10:28:57.736:INFO::main: Logging initialized @186ms"                                                                                                          
##  [4] ""                                                                                                                                                                        
##  [5] "10:28:57.780 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:"                                                              
##  [6] " registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX"
##  [7] "10:28:57.781 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:"                                                                        
##  [8] " registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX"                             
##  [9] "10:28:57.781 INFO - Driver class not found: com.opera.core.systems.OperaDriver"                                                                                          
## [10] "10:28:57.782 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:"                                                                         
## [11] "Unable to create new instances on this machine."                                                                                                                         
## [12] "10:28:57.782 INFO - Driver class not found: com.opera.core.systems.OperaDriver"                                                                                          
## [13] "10:28:57.783 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered"                                                                                
## [14] "10:28:57.784 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:"                                                                    
## [15] " registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX"                                        
## [16] "2017-01-17 10:28:57.815:INFO:osjs.Server:main: jetty-9.2.15.v20160210"                                                                                                   
## [17] ""                                                                                                                                                                        
## [18] "2017-01-17 10:28:57.836:INFO:osjsh.ContextHandler:main: Started [email protected]{/,null,AVAILABLE}"                                                
## [19] ""                                                                                                                                                                        
## [20] "2017-01-17 10:28:57.849:INFO:osjs.ServerConnector:main: Started [email protected]{HTTP/1.1}{0.0.0.0:4567}"                                                        
## [21] ""                                                                                                                                                                        
## [22] "2017-01-17 10:28:57.851:INFO:osjs.Server:main: Started @301ms"                                                                                                           
## [23] ""                                                                                                                                                                        
## [24] "10:28:57.852 INFO - Selenium Server is up and running"                                                                                                                   
## 
## $stdout
## character(0)

The stop function sends a signal that terminates the process:

Available browsers

By default, the selenium function includes paths to chromedriver/geckodriver/phantomjs so that the Chrome/Firefox and PhantomJS browsers are available respectively. All versions (chromever, geckover etc) are given as "latest". If the user passes a value of NULL for any driver, it will be excluded.

On Windows operating systems, the option to included the Internet Explorer driver is also given. This is set to iedrver = NULL so not ran by default. Set it to iedrver = "latest" or a specific version string to include it on your Windows.

Further details

For further details, please see the package vignette.