Selenium click operation doesn’t work sometimes



  • a click operation isn’t processed or a click operation raise other click opration to be processed when operated by selenium code.
  • All the operation works correctly when operated by myself(just click by my finger).

Do you know what’s wrong with it?


  • Macbook Pro /OS X Yosemite(10.10.4)
  • Electron
    • v0.33.1
    • v0.36.1
  • ChromeDriver
    • chromedriver-v2.15-darwin-x64
    • chromedriver_mac32_2_20
  • jQuery 1.11.3


1 At first, I packaged Electron app from the HTML code below.

window.jQuery = window.$ = require("jquery");

$(function() {
  $("#link1").click(function() {

  $("#link2").click(function() {

  $("#link3").click(function() {

<span id="status1"></span><a href="#1" id="link1" class="link">link1</a><br>
<span id="status2"></span><a href="#2" id="link2" class="link">link2</a><br>
<span id="status3"></span><a href="#3" id="link3" class="link">link3</a><br>

2 Launch the app and click each link by my finger from above, then “OK” is displayed. That seems to work correctly.

3 I wrote the selenium ruby code below.

link1 = driver.find_element(:id, 'link1')


link2 = driver.find_element(:id, 'link2')


link3 = driver.find_element(:id, 'link3')

(Below is the point of the issue)

4 Execute the code, then “OK”, “OK” are displayed following, However, 3rd “OK” is not displayed following

Anyone knows what happened?

If I add link4 and execute the selenium code, has started a click event of link4 on the application side.

Best regards,