I want to create function that will allow to fill registration, authorization and other text forms. Something like:
def fill_form(my_list):
forms = driver.find_elements_by_xpath(common_xpath)
for element in forms:
element.send_keys(my_list[forms.index(element)])
It should get as arguments a list of text values to send into <input type="text">
, <input type="password">
and <textarea>
elements.
So far I have:
common_xpath ='//input[@type="text" or @type="password"]'
but I can't understand how to add textarea
element to this XPath
to match it also