samedi 11 novembre 2017

R selenium input email and password at pop up

I want Rselenium to input email and password for at log-in. I managed to open up a chrome, navigate to the log-in site and click on the correct element to open the log-in pop-up. Hereafter, although I find the correct id to input text to the log-in field, RSelenium cannot identify the webelement.

#Add RSelnium to my library
library(RSelenium)
#start a server
rD <- rsDriver(port = 4567L, browser = "chrome")
#get into the client
driver = rD[["client"]]
#get to google
driver$navigate("http://www.google.com")
#reset all cookies first
driver$deleteAllCookies()
#get to tripadvisor
driver$navigate("http://ift.tt/pLwxBF")
#log in
webele <- driver$findElement(using = "class name","login-button")
webele$clickElement()

#At this point I need to use the find driver$findElements to find the email id "regSignIn.email" however I get this error #Add RSelnium to my library
library(RSelenium)
#start a server
rD <- rsDriver(port = 4567L, browser = "chrome")
#get into the client
driver = rD[["client"]]
#get to google
driver$navigate("http://www.google.com")
#reset all cookies first
driver$deleteAllCookies()
#get to tripadvisor
driver$navigate("http://ift.tt/pLwxBF")
#log in
webele <- driver$findElement(using = "class name","login-button")
webele$clickElement()
#Add RSelnium to my library
library(RSelenium)
#start a server
rD <- rsDriver(port = 4567L, browser = "chrome")
#get into the client
driver = rD[["client"]]
#get to google
driver$navigate("http://www.google.com")
#reset all cookies first
driver$deleteAllCookies()
#get to tripadvisor
driver$navigate("http://ift.tt/pLwxBF")
#log in
webele <- driver$findElement(using = "class name","login-button")
webele$clickElement()
#now from the pop up I want to input the email address and password, 
#however, I cannot find the webelement




Aucun commentaire:

Enregistrer un commentaire