I\'m using Selenium with Python (Chorme driver) to write something in a text box but there are a lot of textboxes and I need it to fill them faster. I use a sequences of
<
You can try to set values using javascript:
orderBillingName = driver.find_element_by_id("order_billing_name")
driver.execute_script("arguments[0].value=arguments[1];", orderBillingName, "mytext")
You can set all directly with javascript:
driver.execute_script("document.querySelector('#order_billing_name').value='mytext';"\
"document.querySelector('.order_number_class').value='12323';"\
"document.querySelector('input#anotherinputid').value='anything';")
Example for a lot fields:
fields = {
"input#order_billing_name": "some text",
".order_number_class" : "some text",
"css selector" : "some text",
"css selector" : "some text",
"css selector" : "some text"
}
js = ""
for selector, value in fields.items():
js = js + "document.querySelector('" + selector + "').value='"+ value +"';"
driver.execute_script(js)