Macro stalling on opening a new tab

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
jndavis
Posts: 4
Joined: Wed Mar 04, 2015 5:42 pm

Macro stalling on opening a new tab

Post by jndavis » Wed Mar 04, 2015 6:22 pm

Hi all,

I do apologize if I've overlooked something in previous posts or the FAQ, but I really haven't been able to find anything that addresses this issue (or if I did, perhaps I didn't understand the post--I inherited this responsibility, and am occasionally out of my depth in some of the more technical aspects of what I do). I'm running a macro to try to automate an audit process that I manage here in our office for a very old version of the iMacros Browser (5.something). Our database was recently updated, and I can't use that browser any more, so I was trying to transition to the Firefox addon.

I've got iMacros for Firefox 8.8.9 running in Firefox ESR 31.4.0 on a Windows 7 64-bit machine. The only part of the macro that I haven't been able to get to work correctly is the following section:

TAG POS=1 TYPE=A ATTR=ID:BasicDataTable_Notes
TAB T=2
FRAME F=0
TAG POS=1 TYPE=IMG ATTR=SRC:https://www.ourdatabase.com/images/btnAddNew.gif
TAG POS=1 TYPE=SELECT FORM=NAME:MainForm ATTR=NAME:CategorySelect CONTENT=22
TAG POS=1 TYPE=TEXTAREA FORM=NAME:MainForm ATTR=NAME:Text CONTENT=Blah<SP>blah<SP>texty<SP>blah<SP>blah
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:MainForm ATTR=NAME:&&VALUE:
TAG POS=1 TYPE=IMG ATTR=HREF:https://www.ourdatabase.com()

It's opening the new tab to get to the notes screen of the record, and then correctly going to the new tab, but then it stops. The script isn't timing out or giving me an error, it just stops on the TAB T=2 step and doesn't move on. I've tried playing around with (and removing entirely) the Frame reference, but that doesn't seem to help. I've tried using the record macro feature to duplicate the macro actions manually, and I end up with the same steps (no Frame reference is being recorded), but when I try to run that as a macro, I run into the same issue of stopping at T=2 (and still not timing out or giving any error). Any suggestions you might be able to offer would be greatly appreciated!

josh
chivracq
Posts: 9430
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Macro stalling on opening a new tab

Post by chivracq » Wed Mar 04, 2015 7:08 pm

jndavis wrote:Hi all,

I do apologize if I've overlooked something in previous posts or the FAQ, but I really haven't been able to find anything that addresses this issue (or if I did, perhaps I didn't understand the post--I inherited this responsibility, and am occasionally out of my depth in some of the more technical aspects of what I do). I'm running a macro to try to automate an audit process that I manage here in our office for a very old version of the iMacros Browser (5.something). Our database was recently updated, and I can't use that browser any more, so I was trying to transition to the Firefox addon.

I've got iMacros for Firefox 8.8.9 running in Firefox ESR 31.4.0 on a Windows 7 64-bit machine. The only part of the macro that I haven't been able to get to work correctly is the following section:

Code: Select all

TAG POS=1 TYPE=A ATTR=ID:BasicDataTable_Notes
TAB T=2     
FRAME F=0     
TAG POS=1 TYPE=IMG ATTR=SRC:https://www.ourdatabase.com/images/btnAddNew.gif
TAG POS=1 TYPE=SELECT FORM=NAME:MainForm ATTR=NAME:CategorySelect CONTENT=22
TAG POS=1 TYPE=TEXTAREA FORM=NAME:MainForm ATTR=NAME:Text CONTENT=Blah<SP>blah<SP>texty<SP>blah<SP>blah 
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:MainForm ATTR=NAME:&&VALUE:  
TAG POS=1 TYPE=IMG ATTR=HREF:https://www.ourdatabase.com()   
It's opening the new tab to get to the notes screen of the record, and then correctly going to the new tab, but then it stops. The script isn't timing out or giving me an error, it just stops on the TAB T=2 step and doesn't move on. I've tried playing around with (and removing entirely) the Frame reference, but that doesn't seem to help. I've tried using the record macro feature to duplicate the macro actions manually, and I end up with the same steps (no Frame reference is being recorded), but when I try to run that as a macro, I run into the same issue of stopping at T=2 (and still not timing out or giving any error). Any suggestions you might be able to offer would be greatly appreciated!

josh
You are not using '!ERRORIGNORE' by any chance at the beginning of your Script...? (That would prevent any RuntimeError... But if the Macro is not timing out as you mention, that means the Button is found.)

But your Button is a .GIF Image and you sometimes have Web-Pages with .GIF Buttons and one .GIF Button is actually 2 .GIF Buttons, one .GIF is displayed in normal time and when the Mouse hovers over it, it changes into a different .GIF which is the one being recorded by iMacros, but the JavaScript Action is actually on the other one, so you need to manually edit your Script with the name of the first .GIF...

You can try with POS=2 etc to make sure there is only one Button on that Page, or if there are several, that POS=1 corresponds to the Button that you want to click... You could use Relative Positioning otherwise, by first clicking/tagging some Label or other Field positioned very close to your Button.

Debug Trick, add some EXTRACT=TXT/ALT/TITLE/HTM to make sure that iMacros find the correct Button (and that you don't get any "#EANF#"...).

You could try the EVENT Mode as well...

The FRAME F=0 is normally meant for switching back to the Main Frame after you've done some other Action on some inner Frame, check that this is the case indeed and that you didn't copy and paste that part of Code some other place in your Macro or from some other Macro...

Difficult to give you more advice without being able to play myself with the Page... Hope this helps already...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
jndavis
Posts: 4
Joined: Wed Mar 04, 2015 5:42 pm

Re: Macro stalling on opening a new tab

Post by jndavis » Thu Mar 05, 2015 4:15 pm

Thank you for your reply! No, I'm not using !ERRORIGNORE in the script, and it definitely did time out at some of the earlier steps when there was an error.

I tried with POS=2, but the same thing (i.e., nothing) happened. I don't know if it will help, but here's a screenshot of what I'm seeing when I run the script (this is after it's been running and stalled at that step for a few minutes). I tried changing to POS=2 in the script running in the picture, but I will try to play around with some of your other suggestions.
Capture.PNG
If it's not finding the button that I need to click (whether because of positioning or the dual .GIF issue you mentioned), shouldn't I expect to see an error of some sort (or at least that the script stalls at that step)?
jndavis
Posts: 4
Joined: Wed Mar 04, 2015 5:42 pm

Re: Macro stalling on opening a new tab

Post by jndavis » Fri Mar 06, 2015 4:22 pm

So, just a quick update: I've tried playing around with the EVENT mode, and I'm getting the same results. It seems to be recording the actions correctly, and will duplicate all of them until it gets to the point of opening the new tab. Once the new tab is open, it's brought to the foreground but it won't move on to the next step; it just stays at the step T=2 indefinitely, without timing out or giving any other error message.

I tried recording the last steps (clicking the Add New button, entering the text, and saving the note), both in Event Mode and in the regular mode. Both recordings will replay just fine when the script is just running in that tab only. I've tried playing the Tabs.iim demo script, and that works. I tried adding a line to close the first tab, but I think I have to move to the second tab first, and then the script pauses at that step.

Any other ideas?
chivracq
Posts: 9430
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Macro stalling on opening a new tab

Post by chivracq » Sat Mar 07, 2015 9:10 am

No, not really, I would need to be able to play myself with the Page(s)... Can you upload a Full HTML Saveas of both Pages (in 1 or 2 .ZIP File(s) if you want to be able to upload it/them to the Forum...)?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
lumer8
Posts: 17
Joined: Tue Sep 02, 2014 3:15 am

Re: Macro stalling on opening a new tab

Post by lumer8 » Sun Mar 08, 2015 7:50 am

its not working because of that frame tag, its not playing the code in the correct frame. i would play around with the frame number, try 1-6.
jndavis
Posts: 4
Joined: Wed Mar 04, 2015 5:42 pm

Re: Macro stalling on opening a new tab

Post by jndavis » Tue Mar 10, 2015 4:55 pm

Thanks for your suggestion, lumer8. I tried changing the Frame tag today (tried 1-6), but that doesn't seem to matter at all. The script never replays that step; it freezes on Step 26 (T=2) and doesn't move on or time out or give any other indication that there's an error. I also tried playing around with a few frame tags earlier in the script, and it definitely gives me an error message when the frame tag is wrong.

Attached are the saveas files for the main page (the link for accessing the notes is persistent in that menu bar across any of the tabs) and the notes page. I really appreciate your feedback and attempted assistance thus far!
Post Reply