Jump to content

_IEAction 'click' is not working properly


Recommended Posts

Hello Friends,

I am new to autoIt and new to this forum as well,

I have one web form which has <a> tag, once it clicks it will open some content on the frame, <a>  tag dose not have id and I am handling with click event, now the problem first time it will work perfectly but if I run second time _IEAction() click is not working, but if I clear the IE browser history and run then script will work. code is given below, please help me to find the issue. 

 

$oLinks = _IETagNameGetCollection($oIE, 'a')
            For $oLink In $oLinks
                $sRef = $oLink.getAttributeNode('onclick').NodeValue
                If StringInStr($sRef, "javascript:PrintTrack('#abc-1')") > 0 Then
                    _IEAction($oLink, 'click')
                    ExitLoop
                EndIf
            Next

Link to post
Share on other sites
Link to post
Share on other sites

  No tag is not in the frame its inside the div once its clicked it will open print page                               

<div class="print-download-blk right hideClass" id="printBtns" data-html2canvas-ignore="">
<a class="print-link red-btn " onclick="javascript:PrintTrack('#card-1')" href="#">
Print
<img width="9" height="12" src="/images/print-icon.png">
</a>
 </div>

Link to post
Share on other sites

Yes your correct there is the deference in my link and the search text, that I have given as a sample actual code given below 

        $oLinks = _IETagNameGetCollection($oIE, 'a')
        For $oLink In $oLinks
            $sRef = $oLink.getAttributeNode('onclick').NodeValue
            If StringInStr($sRef, "javascript:PrintTrack('#card-1')") > 0 Then
                _IEAction($oLink, 'click')
                ExitLoop
            EndIf
        Next
 

As you suggest, I tried to catch the event by_IELinkClickByText but no luck, while executing I am getting below error on the console and its not getting clicked, but text "Print" is already available.

Print  --> IE.au3 T3.0-2 Warning from function _IELinkClickByText, $_IESTATUS_NoMatch

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...