title: Is it possible to run RSelenium in ShinyApp on the RStudio server?
body: <p>I faced such an issue: i have Rscript that uses RSelenium to navigate pages, click buttons and collect data. I included this script as a function in my shinyApp. When I run it from my machine everything is as expected: after clicking the button firefox launches and process in running corretly.</p>
  
  <p>The trouble occured when I wanted to publish script on Rstudio server (under Linux) in my company  in order to provide access to the tool (written under Windows) by link. After running this:</p>
  
  <pre><code>rD&lt;-rsDriver(port=4441L, browser="firefox", chromever=NULL, iedrver = NULL, phantomver = NULL)
  </code></pre>
  
  <p>A receive this output:</p>
  
  <pre><code>    $client
  [1] "No sessionInfo. Client browser is mostly likely not opened."
  $server
  Process Handle
  command   : /tmp/RtmpElIBko/file3a0241d505d8.sh 
  system id : 15293
  state     : exited
  </code></pre>
  
  <p>So the server is running, but browser can't be opened</p>
  
  <p>server log is:</p>
  
  <pre><code>$stderr
   [1] "14:22:06.908 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'"                                                                                        
   [2] "14:22:06.910 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4441"                                                                                              
   [3] "2018-05-15 14:22:07.026:INFO::main: Logging initialized @452ms to org.seleniumhq.jetty9.util.log.StdErrLog"                                                                                     
   [4] "14:22:07.227 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4441"                                                                                                       
   [5] "14:22:08.467 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {browserName: firefox, javascriptEnabled: true, nativeEvents: true, version: }"                                 
   [6] "14:22:08.469 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)"
   [7] "1526383328500\tgeckodriver\tINFO\tgeckodriver 0.20.1"                                                                                                                                           
   [8] "1526383328506\tgeckodriver\tINFO\tListening on 127.0.0.1:30716"                                                                                                                                 
   [9] "1526383328777\tmozrunner::runner\tINFO\tRunning command: \"/usr/bin/firefox\" \"-marionette\" \"-profile\" \"/tmp/rust_mozprofile.KCqtcRfWkHTS\""                                               
  [10] "No protocol specified"                                                                                                                                                                          
  [11] "Error: cannot open display: :0" 
  </code></pre>
  
  <p>My thoughts: on local machine I had browser installed and it's path is stored in <code>PATH</code> variable. I had nothing in the server, so it is unclear what should be opened.</p>
  
  <p>What I tried to do: by this time i'm waiting for my IT department to install the browser on server (I even don't know whether it sounds like madness) because I have no permissions. 
  I uploaded Mozilla browser from my computer to the server and ran such a lines to launch browser without RSelenium, directly:</p>
  
  <pre><code>  system('java -Dwebdriver.firefox.bin="\\R\\Wordstat Yandex\\Mozilla\\firefox.exe"')
    system('java -Dwebdriver.gecko.driver,"R\\Wordstat Yandex\\geckodriver"')
    system('export PATH=$PATH:"\\R\\Wordstat Yandex\\Mozilla\\firefox.exe"')
    system("./firefox.exe")
  </code></pre>
  
  <p>which returns permission error:</p>
  
  <pre><code>sh: ./firefox.exe: Permission denied
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Is it possible to install browser on server (I copied folder and
  probably is was wrong)</li>
  <li>If answer for point 1 is "yes' then how it
  should be done corretly (i.e, should it be linux ver. of firefox
  installed?)</li>
  <li>If answer is "no" then are there any other ways to
  run Rselenium based scripts within shinyapp from Rstudio server
  (assumning it works in shinyapp locally)</li>
  </ol>
  
  <p>By this time what I saw in Google was how to test shinyapp using RSelenium. If  i put both these words in one search query  the result  is approximately the same.</p>
  
  <p>Many thanks for any help)</p>