Forum Discussion

olga_ulchina's avatar
olga_ulchina
Occasional Contributor
11 years ago

Event bound to a button or link not executed on click

I am testing a website in IE10 using vbscript.



I mapped a link on a page and I want to click on this link (after clicking I expect an alert). When running my script I can see in TestComplete logs that click on link was performed, but the expected action was not executed, in my case alert didn't appear on screen. However in FF it works fine. 



I am sure it's not a timing issue, I tried it with aqUtils.Delay with no success.



IE browser is my highest  priority, do you have any suggestions how to make it work in IE? Or at least what could be the problem..





  • Hi Olga,



    What if you try to emulate the click? Something like this (untested pseudo-code):

    Set lnk = ...

    Call lnk.ScrollIntoView(False)

    lnk.HoverMouse

    Call aqUtils.Delay(500)

    Call LLPlayer.MouseDown(Win32API.VK_LBUTTON, _

        lnk.ScreenLeft + 5, lnk.ScreenTop + 1, 500)

    Call LLPlayer.MouseUp(Win32API.VK_LBUTTON, _

        lnk.ScreenLeft + 5, lnk.ScreenTop + 1, 500)



    Does it help?
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Olga,



    What if you try to emulate the click? Something like this (untested pseudo-code):

    Set lnk = ...

    Call lnk.ScrollIntoView(False)

    lnk.HoverMouse

    Call aqUtils.Delay(500)

    Call LLPlayer.MouseDown(Win32API.VK_LBUTTON, _

        lnk.ScreenLeft + 5, lnk.ScreenTop + 1, 500)

    Call LLPlayer.MouseUp(Win32API.VK_LBUTTON, _

        lnk.ScreenLeft + 5, lnk.ScreenTop + 1, 500)



    Does it help?
  • Hi Olga,

    I have had similar issues.

    I disussed the problem with one of our developers and he told me that they altered the way the UI object works for efficiency.  The strange thing is it works if I manually click on the UI objects, but Test Complete doesn't appear to be triggering the events.



    To get around this, I get the link the object points to when the UI object is clicked and I just navigate to it.





  • olga_ulchina's avatar
    olga_ulchina
    Occasional Contributor
    Thanks, Adrian, this could be a solution, but I have some JavaScript bound to this link, not only URL where to redirect..