selenium python send_key error: list object has no attribute selenium python send_key error: list object has no attribute selenium selenium

selenium python send_key error: list object has no attribute


You are getting a List of webElements with driver.find_elements_by_xpath(".//*[@id='UserName']") which of course not a single element and does not have send_keys() method. use find_element_by_xpath instead. Refer to this api doc.

userID = driver.find_element_by_xpath(".//*[@id='UserName']")userID.send_keys('username')


instead of this:

userID = driver.find_elements_by_xpath(".//*[@id='UserName']")userID.send_keys('username')

try:

userID = driver.find_element_by_xpath(".//*[@id='UserName']")userID.send_keys('username')

I had the same issues and that worked for me.


driver.find_element_by_xpath(".//*[@id='UserName']").send_keys('username')

find_element without s.