Sign in to follow this  
Followers 0
hagaizenberg

onmouseup doesn't work with _IEAction click

3 posts in this topic

Hi,

I've been using AutoIt with Internet Explorer to automate some stuff and I came across this problem:

I have an link i wanna click that has both onmouseup and onclick, something like:

<a href="#" .... onmouseup="func1();" onclick="func2();">Some Text</a>

Problem is that when i use _IEAction with "click" it seems that it only perform the onclick function and not the onmouseup function.

Am I doing something wrong? is there a way to simulate the mouseup?

Here's the code, I've tried using other methods such as focus and so but with no luck):

$oInputs = _IETagNameGetCollection ($oIE, "a")
For $oInput In $oInputs
    If StringCompare($oInput.innerHtml,$value) == 0 Then
    traceLog("Found "&$value& " in innterHtml, now clicking it")
    ;_IEAction($oInput, "focus")
    _IEAction($oInput, "click")
    If @error > 0 Then
        traceLog("_IEAction Click on link with innerHtml "&$value&" failed with @error = "&@error )
        _IELoadWait ($oIE)      
        return False
    Else
            traceLog("_IEAction Click on link with innerHtml "&$value&" succesfull")
        _IELoadWait ($oIE)      
        return True
    EndIf
    EndIf
Next

Any ideas?

10x.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try :

$oInput.FireEvent("onclick")

$oInput.FireEvent("onmouseup")

Edited by Juvigy

Share this post


Link to post
Share on other sites

You Rock!!

This works perfectly!!

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0