Forum Discussion

morde's avatar
morde
Contributor
12 years ago

Click method is sometimes not executed

Hi.



I have a wired issue, sometimes I see on the log file that a certain button or link where clicked, but the actual Click didn't happen (the form or page that were supposed to open - did not).  Since I can see the red sign of the mouse on the object - I know it went to the right object. It also doesn't reproduce manually, So what could be the problem?



Thanks.

5 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Usually overlapping controls will generate an error/warning to the log. Also make sure that the page isn't still loading when the click is performed.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    A possibility:  That there is some other non-visible object overlaying the object you are trying to click on.  So, you say click on Object1 but Object2 is covering it.  So, the screenshot shows a click on Object1 but Object2 actually received the click.



    Something you can try is to do just a quick-and-dirty record of the click on the object to see what object actually gets "clicked" to get your behavior to work.
  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    The first thing we do if Click is being stubborn is that we put a Focus right before it.  



    The other thing to try is to put a short Delay right before the Click (and before the Focus if you have it).  It may appear as though the button is ready to be clicked but there may be something loading in the background that keeps that from being true (like what ryan said).







  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    It's not ideal, but I've had to place hard set delays in such cases.

    One benefit of those delays however is that I can always count on my tests to fail if the page takes too long to load...which yes I do want to happen because I want to know if changes have added to longer load times. Of course make sure you place enough delay to account for general network / web latency etc. assuming this is what's happening.
  • Hi, Thanks for the answers!



    A while ago I used some hard-coded delays between some actions which requires page-loading. The stubborn Clicks happens in a very very small precent of the times I click on links/buttons - each time in a different one. Now I'm trying to find something better then a hard-coded delay. I would consider a Focus.



    Thank you guys!