retry: Documetation of retry argument

Description Examples

Description

The ability to retry function code is enabled by default. retry can be a logical value. if it is TRUE then noTry = getOption("seleniumPipes_no_try") and delay = getOption("seleniumPipes_no_try_delay"). If it is FALSE the facility to have multiple trys of the function call is removed. retry can also be a list with the following named arguments that will override the values in options

"noTry"

Integer indicating how many times to try the function call

"delay"

Integer indicating delay between trys of the function call

Examples

 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
## Not run: 
remDr <- remoteDr()
webElem <- remDr %>% go("http://www.google.com/ncr") %>%
  findElement("name", "q")
# change the name of q with an 8 second delay
myscript <- "var myElem = arguments[0];
window.setTimeout(function(){
 myElem.setAttribute('name','funkyname');
}, 8000);"
remDr %>% executeScript(myscript, args = list(webElem))

newWebElem <- remDr %>% findElement("name", "funkyname")

# > newWebElem <- remDr %>% findElement("name", "funkyname")
#
# Calling  findElement  - Try no:  1  of  3
#
# Calling  findElement  - Try no:  2  of  3

newWebElem %>% getElementAttribute("name")

# compare with a function that will fail (no element present)
remDr %>% findElement("id", "i am not here", retry = list(noTry = 5, delay = 10))
remDr %>% findElement("id", "i am not here", retry = FALSE)

## End(Not run)

seleniumPipes documentation built on May 2, 2019, 5:57 a.m.