## 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)
Run the code above in your browser using DataLab