Selenium Auto Submits Form with Send_keys?
<p>I'm using Selenium 2.53 with python 3.4 firefox 47 to do automation testing. When using .send_keys (sendKeys in Java) it will auto submit the form when I dont want it to.</p>

<p>The form input that I'm sending keys to is:</p>

<pre><code>&lt;input tabindex="1" type="text"
                    name="PostingTitle"
                    id="PostingTitle"
                    maxlength="70"
            &lt;/label&gt;
</code></pre>

<p>It's strange because it doesnt do this with all the forms. Is there a way to tell selenium not to submit?</p>

<blockquote>
  <p>When using .send_keys (sendKeys in Java) it will auto submit the form when I dont want it to.</p>
</blockquote>

<p>It might be possible your desired text box is capturing key events during sendKeys which may be call any JavaScript function to submit the form, because <code>sendKeys</code> working normally as user input from keys.</p>

<p>From comments :-</p>

<blockquote>
  <p>No new line and no 'enter' or 'return' or related keys.
  No event occuring during sendKeys on the html.</p>
</blockquote>

<p>Then it's hard to say why <code>sendKeys</code> submit your form.</p>

<p>You can use <code>execute_script()</code> instead which would silently set the value into your textbox without occuring any events as :-</p>

<pre><code>driver.execute_script("arguments[0].value = arguments[1]", driver.find_element_by_id("PostingTitle"), "youââr value to set")
</code></pre>

python selenium selenium-webdriver