Jump to content
Sign in to follow this  

Unable to do _IEAction click on an Anchor

Recommended Posts


I'm trying to submit some details automatically in AutoIt. Basically I fill in a field and click on a button which is represented in HTML as an anchor with the following HTML

<A class=menulink HREF="java script: quicktask_onsubmit();"><B>Go</B>.</A>

Does anyone have any ideas how to simulate a mouse click on this anchor?

I tried the following

$oTags = _IETagNameGetCollection ($o_mainPageRightFrame, "a")
For $oTag In $oTags
    $oGo = $oTag.getAttributeNode("HREF")
    If StringInStr($oGo.value, "quicktask_onsubmit()") Then 
_IEAction ($oGo, "click")

But I get an AutoIt Error

Line 2795 (File "C:\Program Files\AutoIt3\Include\IE.au3")

Error: The requested action with this object has failed.

Thanks in advance.

Edited by acha114

Share this post

Link to post
Share on other sites

Apparently you cant do _IEAction on an anchor, it must be an Internet Explorer object. I have worked around this by using _IELinkClickByIndex, by passing the value of the index that the link corresponds to (just a hardcoded value) and it works now

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