Selenium python- how can I fill all input fields at once
<p>Is it possible to fill all the fields on the page at once instead of one by one?</p>

<p>Right now I have</p>

<pre><code>driver.find_element_by_id('1').send_keys(input1)
driver.find_element_by_id('2').send_keys(input2)
driver.find_element_by_id('3').send_keys(input3)
</code></pre>

<p>and it goes one by one taking a while to fill a form.</p>

<p>You may construct a <code>dict</code> in python to store the values corresponding to id and Iterate over it to fill up the corresponding data.</p>

<pre><code>input_mapping = {"1": "input1", "2": "input2", "3": "input3"}

for key, value in input_mapping.items():
    driver.find_element_by_id(key).send_keys(value)
</code></pre>

<p>But the above approach won't be sequential. as the dictionary maintains no order on it's own. So it would be a better choice to use <code>collections.OrderedDict()</code> if the order really matters</p>

python selenium webdriver