How put a text in Rselenium with sendKeysToElement()?

Hi community,

I'm want to write in box of this page. In the same form fill others field, an finally press enter or apply filter on page. But when I try use sendKeysToElement() don't put the text correctly.


# Establecer conección --------------------------------------------------
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "chrome")

# Navegar -----------------------------------------------------------------
remDr$navigate(url = "")

# Dar click en [I AGREE] -----------------------------------------------------
remDr$findElement(using = 'xpath', "//*[@id='the-app']/div/div[2]/div/div[2]/button")$clickElement()

# Dar click en [ACCESION DATA] -----------------------------------------------------
remDr$findElement(using = 'xpath', "//*[@id='the-app']/div/div/div[1]/header/div/div[2]/nav/div[1]/div[1]/span")$clickElement()

# Dar click en [PASSPORTDATA] -----------------------------------------------------
remDr$findElement(using = 'xpath', 
## Esperar 5 seg de carga

# Dar click en [HOLDING INSTITUTE] -----------------------------------------------------
remDr$findElement(using = 'xpath', 

address_element <- remDr$findElement(using = 'xpath', 


address_element$sendKeysToElement(list("COL003",key = "enter"))  # This part dont put the text 

I need put in address_element this text "COL003" and press enter.

Im try with other selectors like css and id, but dont run well.

How make this?

Hi, yeah looks like the ID is used in the label, too. Have you tried making sure it is pointed to the input field with the ID? Something like:

address_element <- remDr$findElement(using = 'xpath',  "//input[@id='auto-institute.code']")
address_element$sendKeysToElement(list("COL003", key = "enter"))
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.