selenium click() skipping
<p>I have been doing some work with selenium lately and I am having an issue with the click() function.</p>

<p>Given the following HTML code:</p>

<pre><code>    &lt;div id="sendreply"&gt;
      &lt;input type="submit" class="button norm-green" value=
      "Send Message name="sendmessage"&gt; == $0
    &lt;/div&gt;
</code></pre>

<p>I have been trying to click on the "Send Message" button however click() just passes over the action and the program proceeds to downstream operation.</p>

<p>I have tried finding the element by both name and xpath:</p>

<pre><code>    time.sleep(2)
    option='by_name'
    if option == 'by_name':
        driver.find_element_by_name('sendmessage').click()
    else:
        driver.find_element_by_xpath("//div[@id='sendreply']").click()
</code></pre>

<p>I get no error code whatsoever.</p>

<p>Any help greatly appreciated.</p>

<p>If you've tried all but nothing get success, try using <code>execute_script()</code> as an alternate solution to perform click and get rid from this issue as below :-</p>

<pre><code>driver.execute_script("arguments[0].click()", driver.find_element_by_name('sendmessage'))
</code></pre>

<p><strong>Warning</strong>:- The <code>JavaScript</code> injection <code>HTMLElement#click()</code> shouldn't be used in a testing context. It defeats the purpose of the test. First because it doesn't generate all the events like a real click <code>(focus, blur, mousedown, mouseup...)</code> and second because it doesn't guarantee that a real user can interact with the element. But you can use it as an alternate solution to get rid from this issue.</p>

python selenium-webdriver