You need to send the name of your file to the DOM element for download. Here's an example using the Brilliant app for an example download.
require(RSelenium)
RSelenium::startServer()
remDr <- remoteDriver()
remDr$open()
remDr$navigate("https://gallery.shinyapps.io/uploadfile")
webElem <- remDr$findElement("id", "file1")
testCsv <- tempfile(fileext = ".csv")
x <- data.frame(a = 1:4, b = 5:8, c = letters[1:4])
write.csv(x, testCsv, row.names = FALSE)
webElem$sendKeysToElement(list(testCsv))
remDr$close()
remDr$closeServer()
So, in the case of your code, it would be enough to send the file name to your web element:
webEl$sendKeysToElement(list('path/to/my/rdata.Rdata'))
source
share