page reloads in line execution??????????

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
jdockery
Posts: 4
Joined: Sat May 15, 2010 6:06 am

page reloads in line execution??????????

Post by jdockery » Sun May 16, 2010 7:53 pm

These lines are embedded in a javascript loop and this is small section of the code causing the problem:

The scenario is, the page has loaded (ie. Url = Goto...Blah)

"Removed Code Here and Placed the final Draft at the bottom of Page"

What is happening, is during line execution, at random, some of the lines are causing a page reload (In the imacros window, the page never itself never reloads unless i issue the command "URL GOTO" command). I've had it freeze and timeout on WAIT, SET !ERRORIGNORE, and the TAGS. The reloading is 60s. Sometimes it executes fine and on another pass it will freeze.

This has happened before with other programs as well and is not isolated to just this one.

I have a WAIT SECONDS = 300 prior to this code which is more than enough time for the page to load, which i visually see it do. There is no redirects away from the frame. There are no REFRESH's being executed post the page load. Thinking the problem might be associated with some of the ad's i used the built in image load blocker in Firefox 3.6.3 to block them from loading...........that did speed up load time on the initial URL GOTO command, but did not alleviate the problem.

I have firefox set to clear history, cache, etc. on close.
add-ons i have included: AFOM and Tweak Network Settings

Manually, i can execute all the commands (without error), quicker than imacros is executing.

Any thoughts would be greatly appreciated, especially why a page reload (In the imacros window, the page never itself never reloads unless i issue the command "URL GOTO" command) is being issued on !ERRORIGNORE or WAIT execution.

_____________________________________________
Added 5/16/10

Well I decided to include a bit more info:

On manually loading the page today, i did notice in the status bar "Transferring data from" BLAH for an extended period. The page looks entirely loaded, and is responsive to all manual interaction. Now by my understanding, "SET !ERRORIGNORE YES" would ignore whether external data was loaded and continue w/ the "TAG" statements, if they exist. Although, instead of receiving the normal 6sec timeout or 2sec as i have set the "TAGS" for, i get page loading with 60 second timeouts (In the imacros window, the page never itself never reloads unless i issue the command "URL GOTO" command). If the page had not loaded i could understand this error and would just set the "PAGE TIMEOUT" to a higher value, albeit this is not the case. If i visually watch the commands execute, i can manually click on the intended target ("TAG") and the code proceeds prior to the loading timeout of 60 seconds, otherwise it becomes unresponsive.
In other cases, the code continues independently of the "PAGE TIMEOUT", upon manual interaction.

I have set the speed replay to MEDIUM and SLOW, no difference.
I have included WAIT's from 2-10 seconds within the code to no avail.
The code is set to refresh the page after every execution and on errors.

I shall examine the code more carefully and see if there is more error capturing methods i can add to amend this as of no response yet.

__________________________________________________________________
Added 5/17/10

I have added additional error capturing lines at the end of imacros script.
do
{
z=0

CODE

if(iimGetLastError() == "OK")
{z=1;}
}
while(z!=1)

While the insertion of this has helped capture most errors, 802 errors are still not handled properly. As long as the code is freezing within the imacros script it cannot be handled by the javascript error handlers and i imagine the other langauges. Unless i'm missing some command reference to handle errors within imacros script itself, this appears to be a roadblock.

Here is a look at the final version of the initiate function: (Information i considered useless has been omitted as this occurs on several webpages. The declarations and array was also omitted, as they are not causing a problem. The main function was omitted as all it does is call the functions and test the returns.)

function Test1()
{
do
{
try <-I realize this does nothing, but should java decides to crash here it will be captured
{i=0;
iimPlay("CODE:SET !TIMEOUT_PAGE 60"+
"\nSET !ERRORIGNORE YES" +
"\nURL GOTO=BLAH"+
"\nWAIT SECONDS = 3" + <-have had the code freeze here among other odd lines within the macros, ......how do u capture that?
"\nFRAME F=2" +
"\nWAIT SECONDS = 3" +
"\nTAG POS=1 TYPE=A ATTR=ID:BLAH"+
"\nTAG POS=1 TYPE=A ATTR=ID:BLAH"+
"\nTAG POS=1 TYPE=A ATTR=ID:BLAH" +
"\nWAIT SECONDS = 3" +
"\nTAG POS=1 TYPE=SPAN ATTR=TXT:BLAH" +
"\nTAG POS=1 TYPE=SPAN ATTR=TXT:View EXTRACT=TXT");
if(iimGetLastError() == "OK") <- This should capture any errors and cause code to be reexecuted
{i=1;}

}
catch(err)
{
i=0;
continue;
}
}
while(iimGetLastExtract () == "View" && i != 1) <- should capture faulty page loads, was thinking of inserting a if statement to break
this loop and recall the initiate function......but not really the major problem.
return i;
}

This is the final version of the execution commands:

function Execute1()
{
do
{
try
{z=0;
iimPlay("CODE:" +
"\nSET !TIMEOUT_TAG 2"+
"\nSET !ERRORIGNORE YES" +
"\nWAIT SECONDS = 3" +
"\nFRAME F=2"+
"\nWAIT SECONDS = 3" +
"\nTAG POS=1 TYPE=SPAN ATTR=TXT:BLAH"+
"\nWAIT SECONDS = 3" +
"\nTAG POS=1 TYPE=INPUT:TEXT ATTR=ID:BLAH"+
"\nTAG POS=1 TYPE=INPUT:TEXT ATTR=ID:BLAH"+ my_cords1[y][0] +
"\nTAG POS=1 TYPE=INPUT:TEXT ATTR=ID:BLAH"+ my_cords1[y][1] +
"\nTAG POS=1 TYPE=SELECT ATTR=ID:BLAH" +
"\nTAG POS=1 TYPE=SPAN ATTR=TXT:BLAH"+
"\nWAIT SECONDS = 5");
if(iimGetLastError() == "OK") <- This should capture any errors and cause code to be reexecuted
{z=1;}

}
catch(err)
{
continue;
}
}
while(z!=1)
return;
}

Ultimately, it seems i need a try catch version for imacros script..........but i don't think there is such an animal. If anybody gets some grandeur idea, please post, as i'm sure i'm not the only one plagued by this problem.

My System Specs:
Dual Core 2.81 Ghz
3 GB Ram
Bandwidth: 500 Mbps download/ 200 Mbps <- approximate
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: page reloads in line execution??????????

Post by Daniel, Tech Support » Wed May 19, 2010 2:08 pm

Hi,

Thanks for a very detailed post!
Thinking the problem might be associated with some of the ad's i used the built in image load blocker in Firefox 3.6.3 to block them from loading...........that did speed up load time on the initial URL GOTO command, but did not alleviate the problem.
This is almost certainly the case. I would suggest that you decrease the page timeout (not just the tag timeout) to the maximum it takes the page to load and then continue. E.g.:

Code: Select all

SET !TIMEOUT 5
SET !ERRORIGNORE YES
URL GOTO=http://your_url
SET !ERRORIGNORE NO
SET !TIMEOUT 60
Best regards,
Daniel, iOpus Support
jdockery
Posts: 4
Joined: Sat May 15, 2010 6:06 am

Re: page reloads in line execution??????????

Post by jdockery » Sun May 23, 2010 6:33 am

Thank you for the response Daniel.

I have already tried what u suggested. Unfortunately, that does not alleviate the problem.

I do concur, it is the embedded ad's on the page that are causing the problem. On the bright side, at least there's not more ad's, as i have seen on other pages.

I am going to go back and block the ad's individually, and be more specific. Currently i was just using a filter that included all ad's from http://www.mywebpage/ads2/*, but blocking ad's from http://www.mywebpage/ads1/* removed much of the information from the relevant web material.

I think if i include a filter that includes the full url address on these ad's and update as the problem rear's it's ugly head again, it may put an end to the 802 errors. (Keeping fingers crossed)

On a side note: it would be nice to have a feature that captures errors inside imacros code, even if it simply just refreshed the page. I suppose, like i said in my above mentioned post, a try/catch error handler for imacros.

As ad's are a means for web site providers to gain revenue, i do not foresee this problem going away anytime soon and most likely will affect most programs functionality.

Thank you again for your response and have a great weekend.
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: page reloads in line execution??????????

Post by Daniel, Tech Support » Thu May 27, 2010 10:50 pm

Hi,

Thanks a lot for your input!! We don't add things like try/catch to iMacros itself, but we leave it to higher level languages which can work with iMacros via Web Scripting Interface. Basically the reasons are similar to those explained for conditional statements here:
The iMacros language itself is designed as a descriptive language (similar to HTML) and does not contain conditional statements. We did not add such statements as we do not think that our customers should have to attend week-long seminars just to learn yet another proprietary scripting or programming language. In other words, iMacros commands refer to web page elements, so any programming logic must be put into a script that then uses iMacros to automate the website.

So we created the very powerful Scripting Interface that allows you to use iMacros with every Windows Scripting or programming language on the planet. Examples are VBS, VB, VBA, VB.NET, Perl, Java, Foxpro, C, C++, C#, ASP, ASP.NET, PHP and many more. These languages are used by millions of computer users, are reliable and very well documented. We also added a command line interface for use with batch files and task scheduler.
Please let me know if you had any success and if not, I would gladly try to provide a solution, if you give me the URL of the page you're trying to automate.

Thanks again!
Daniel, iOpus Support
jbwocky
Posts: 24
Joined: Fri Aug 28, 2009 7:36 am

Re: page reloads in line execution??????????

Post by jbwocky » Wed May 25, 2011 1:38 pm

Hi,

I'm reviving this issue, since I experienced it recently.
I have a macro which accesses a menu located inside a dialog box which appears on the site. While it chooses the first option of the menu correctly, for the second, third and an input box it starts counting down to 50s. I tried using Set TIMEOUT_PAGE with ERRORIGNORE, but it doesn't work/help.
Now here's another strange thing. If I leave a random tab open next to the one where I'm running my code, I can move to that tab and refresh it - when it's refreshed, the macro suddenly starts working again (without any error), and executes the remaining lines on the correct page/tab (even though I'm located on the other one)... not sure if that helps.
I'm testing an internal web interface, so I can't share its location, but I would be happy to provide any details needed to fix this issue.
Thanks a lot
Emin
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: page reloads in line execution??????????

Post by Daniel, Tech Support » Fri May 27, 2011 10:34 am

Hi Emin,

Sorry for delay! First of all, I'm trying to understand why do you think that this issue is related to the original issue in this topic? Its not that I'm saying that its wrong topic to ask about it :), I'm just trying to see whether the issues are related and can be fixed in a same manner.

Could you attach some screen shot(s) of what is happening and also the macro code, so I get a better picture of the problem?

What if you try to automate the workaround you currently have (open new tab, refresh, return)? Like something similar to:
TAB OPEN
TAB T=2
REFRESH
TAB T=1
...the rest of the code.

Of course it would be better to eliminate the source issue, but if this works as a temporary workaround while we're looking for a permanent fix, that would be good.

Best regards,
Daniel, iOpus Support
Post Reply