Search code examples
imacros

Executing an Angular Method from iMacros


I have a web application I am trying to write a macro for. I have it all working except for the button click event. So I pause the code and manually click the button and then resume the script to the next section, rinse and repeat. I would like to automate the click but I can't find any information on how to do that when working with an angular web app. Below is the button element showing the ng-mousedown event. Any help would be appreciated.

   <button id="nextPageLink" type="button" ng-mousedown="nextPageButtonClick($event)" ng-class="{navButton:!useNavImage('next'),nextNavImage:useNavImage('next'),invalidPage:pageHasErrors(promptForm,nextClickAttempts)}" ng-hide="hideNavButtons()" ng-style="getNavSize('next')" tabindex="2" class="ng-binding nextNavImage" style="width: 44px; height: 32px;">Next<span class="arrow nextArrow"></span>
    </button>

Solution

  • I found it. I enabled the EVENT (Experimental) section and recorded a script clicking the button and I was presented with this nifty little snippet.

    EVENT TYPE=MOUSEDOWN SELECTOR="#nextPageLink" BUTTON=0
    

    Prior to enabling the Experimental section all, I got when I did the same thing was...

    URL GOTO=http://www.whereIwasBeingTakenTo.../.../...
    

    enter image description here