getAlertText {seleniumPipes} | R Documentation |
Get alert text
Description
getAlertText
Get the text from a JavaScript alert.
Usage
getAlertText(remDr, ...)
Arguments
remDr |
An object of class "rDriver". A remote driver object see |
... |
Additonal function arguments - Currently passes the |
Value
The text from the alert is returned.
See Also
Other userPrompts functions: acceptAlert
,
dismissAlert
, sendAlertText
Examples
## 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)
[Package seleniumPipes version 0.3.7 Index]