Refresh on error

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
arnas
Posts: 16
Joined: Fri Jan 20, 2006 4:25 pm

Refresh on error

Post by arnas » Tue Feb 14, 2006 9:20 am

Hi,
I'm using a macro which goes to lots of different links. Some of them fail to load and then macro stops running. I noticed that manual refresh of a page usually helps and macro keeps running.
Q1: can I write somentihing like "if error occours, refresh page once"?
Q2: Can I start macro from the middle of it? Because now what I do, is just open macro text file and cut that part what is already done.
mknoll1
Posts: 174
Joined: Fri Dec 23, 2005 4:14 pm

Post by mknoll1 » Tue Feb 14, 2006 4:31 pm

You could add the REFRESH command after each link. THis will then refresh regardless of whether or not the original load was successful. If I was doing this I would decrease my timeout using set !TIMEOUT 60 and also insert SET !ERRORCONTINUE YES at the top of the script. THis will mean that you won't wait forever if a page is not loading and your script won't fail just because a page fails to load and it can continue on to the next command. THere is also a way to set up a macro to run on error but I have not experimented with this so I don't have any advice on using it.
arnas
Posts: 16
Joined: Fri Jan 20, 2006 4:25 pm

Post by arnas » Wed Feb 15, 2006 6:55 am

Thanks for a tip. But my macro runs very long even now, and if I put refresh command after each link, it will run much longer. I cannot afford that.
The point is, that I need to go to these links in sequence, and I really do not want to miss any of them (it's not crucial, but very important), so that's why I do not want to use SET !ERRORCONTINUE YES.
Maybe there are scripting solutions for this?
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Wed Feb 15, 2006 8:52 am

There certainly is a scripting solution for this. I would split the big macro into many small ones, one macro for each link. Then build a for-loop which goes through all of them. Depending on the returned error code you can then make the script decide what to do, whether to try again or just produce an error message which site could not be loaded.
arnas
Posts: 16
Joined: Fri Jan 20, 2006 4:25 pm

Post by arnas » Mon Feb 20, 2006 1:34 pm

Well, every day I have to run about 100 marcos, and each of them contains 200 links. Splitting them into 20.000 pieces seems to me ureasonable.

Anyway, thanks for answer.

By the way, how about my second question:
Can I start macro from the middle of it?
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Tue Feb 21, 2006 9:40 am

Hi,

no, you cannot jump into a certain position in a macro.

Again, this problem would not occur if you split all your macros.

Another workaround is to read in all the macros as text in one of the script languages available and then split the text into parts, each visiting one webpage, and pass them on to execution by iimPlay("macro commands").

Maybe it's worth investing here and thus saving time later?

Regards,
---
Lasse Clausen, iOpus Support
Post Reply