elementSendKeys: Send a sequence of key strokes to an element.

Description Usage Arguments Value See Also Examples

View source: R/elementInteraction.R

Description

elementSendKeys The elementSendKeys function scrolls into view the form control element and then sends the provided keys to the element. In case the element is not keyboard interactable, an element not interactable error is returned.

Usage

1
elementSendKeys(webElem, ...)

Arguments

webElem

An object of class "wElement". A web Element object see wbElement.

...

keys to send the element. seleniumPipes includes mappings to unicode keys see selKeys. To use one of this name the string using key. See examples.

Value

invisible(webElem): An object of class "wElement" is invisibly returned. A webElement object see wbElement. This allows for chaining from this function to other functions that take such an object as an argument. See examples for further details.

See Also

Other elementInteraction functions: elementClear, elementClick

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
## Not run: 
  # start a brower
  remDr <- remoteDr()
  remDr %>% go("http://www.google.com/ncr")

  queryBox <- remDr %>% findElement("name", "q")

  # send text to the query box
  queryBox %>% elementSendKeys("Some ", "text")

  # clear the query box
  queryBox %>% elementClear

  # get the search button
  searchBtn <- remDr %>% findElement("name", "btnG")
  # send text to query box
  queryBox %>% elementSendKeys("R project")

  # click the search button
  searchBtn %>% elementClick

  # close browser
  remDr %>% deleteSession

## End(Not run)

seleniumPipes documentation built on May 29, 2017, 7:01 p.m.