Description Usage Arguments Value See Also Examples
getAlertText
Get the text from a JavaScript alert.
1 | getAlertText(remDr, ...)
|
remDr |
An object of class "rDriver". A remote driver object see |
... |
Additonal function arguments - Currently passes the |
The text from the alert is returned.
Other userPrompts functions: acceptAlert
,
dismissAlert
, sendAlertText
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
remDr <- remoteDr()
remDr %>% go("https://www.google.com/ncr") %>%
getTitle()
sScript <- "setTimeout(function(){alert('HELLO')},1000); return 'DONE';"
remDr %>% executeScript(sScript, args = list())
remDr %>% dismissAlert()
sScript <- "setTimeout(function(){confirm('Press a button')},1000); return 'DONE';"
remDr %>% executeScript(sScript, args = list())
remDr %>% acceptAlert()
sScript <- "setTimeout(function(){confirm('Press a button')},1000); return 'DONE';"
remDr %>% executeScript(sScript, args = list())
remDr %>% getAlertText()
remDr %>% dismissAlert()
sScript <- "setTimeout(function(){prompt('Please enter your name', '')},1000); return 'DONE';"
remDr %>% executeScript(sScript, args = list())
remDr %>% getAlertText()
remDr %>% sendAlertText("Buck Rogers?")
remDr %>% deleteSession()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.