# Click fails randomly to produce "proper click"

**URL:** <https://forum.robotframework.org/t/click-fails-randomly-to-produce-proper-click/8681>\
**Category:** Browser\
**Created:** [19 March 2025 13:31 UTC](https://forum.robotframework.org/t/click-fails-randomly-to-produce-proper-click/8681 "2025-03-19T13:31:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [19 March 2025 13:31 UTC](https://forum.robotframework.org/t/click-fails-randomly-to-produce-proper-click/8681/1 "2025-03-19T13:31:59Z")

</div>

SUT has html element button with multiple span elements inside it for visualization. I have a testcase that clicks on ID of the initial button (id is unique). This test case is executed 3 times (for all different language variansts) but sometimes the click doesn’t actually trigger the onclick handler of the button. I have a video of the failure and it looks that click is actually being triggered but button only receives focus. There are no overlays, only those span elements that are inside “button”. if the click would go any of the span’s, event bubbling should still trigger onClick ?

Anyone seen this sort of thing ?

---

<div class="post-metadata">

**Author:** ![CharlieScene](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/charliescene/32/3484_2.png) [@CharlieScene](https://forum.robotframework.org/u/CharlieScene)\
**Post date:** [19 March 2025 17:50 UTC](https://forum.robotframework.org/t/click-fails-randomly-to-produce-proper-click/8681/2 "2025-03-19T17:50:34Z")

</div>

Hi,

I don’t know really about sub-span click, but would expect indeed that it triggers.

Didn’t had this on buttons, but on click on table’s line //tr.  
From exe to exe, I had clicks at a x position sometimes that didn’t gave expected results, so went for a fixed position and column.

Did you try a _Click With Options_ to fixed coordinates see if behavior improves?

Regards  
Charlie

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [20 March 2025 09:59 UTC](https://forum.robotframework.org/t/click-fails-randomly-to-produce-proper-click/8681/3 "2025-03-20T09:59:52Z")

</div>

> Did you try a _Click With Options_ to fixed coordinates see if behavior improves?

Nope, didnt try that. This thing was happening in a keyword that selects item in fake unordered list and verifies that selection something like this:

```robotframework
  Click ${plan_name}
  Plan State Should Be ${plan_name} checked ${ignore_ss}

```

And “fixed” this issue with try/except that sends enter (and essentially selecting the focused item)

```robotframework
  Click ${plan_name}
  TRY
    Plan State Should Be ${plan_name} checked ${ignore_ss}
  EXCEPT
    Keyboard Key press Enter
    Plan State Should Be ${plan_name} checked ${ignore_ss}
  END

```

This just feels a bit funky cuz bubbling still should handle this .. maybe.
