JS iimplay return code is 1 when timeout on a website

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
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

JS iimplay return code is 1 when timeout on a website

Post by skippyto » Wed Sep 03, 2008 2:43 pm

Hello !

When playing a macro with a js file, I have the error : "Erreur# 802, Le site web n'a pas répondu (Timeout)"
But it seem this error/warning is not catch by iimGetLastError and iimplay return code is 1.

I want put it in a log file when the load time for a page is more than 60 seconds.

I haven't tried yet with "STOPWATCH", it may be a solution...
But maybe it's possible to catch Timeout errors but i don't know how.

For example, you can reproduce the issue If you add "SET !TIMEOUT 1" in the demo "Demo-Frame.iim" (to be sure having a timeout) and I modify the Demo "Self-Test.js" like this :

/* This script runs all demo macros and displays the success or failure of each run */
/* Created by: iMacros Team, March 18th, 2008 */

var i, retcode;
var report;
var macrolist = new Array();

/* Standard Demo Macros */
macrolist.push("Demos/Demo-FillForm");
macrolist.push("Demos/Demo-Frame.iim");
//macrolist.push("Demo-Filter");
//macrolist.push("Demo-Tabs");
//macrolist.push("Demo-Javascript-Dialogs");
//macrolist.push("Demo-SlideShow");
//macrolist.push("Demo-TagPosition");
/* Macros that save something and/or create logs */
//macrolist.push("Demo-Download");
//macrolist.push("Demo-SaveAs");
//macrolist.push("Demo-SavePDF");
/* Macros that create reports */
//macrolist.push("Demo-Stopwatch");
/* Macros that extract information */
//macrolist.push("Demo-ExtractAndFill");
//macrolist.push("Demo-Extract");
//macrolist.push("Demo-ExtractURL");
//macrolist.push("Demo-ExtractRelative");



//iimDisplay("Start Self Test");

report = "Self-Test Report\n\n";

for (i = 0; i < macrolist.length; i++) {
try{
//iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist);
retcode = iimPlay(macrolist);
report += macrolist;
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
/* display the FIRST extracted item in report*/
s = iimGetLastExtract(1);
if ( s != "" ) report += ", Extract: "+s;
}
report += "\n";
}catch(e)
{
alert ("e: " + e + "\nreport : " + report + "\niimGetLastError : " +iimGetLastError()) ;
}
}
alert ( report );
//iimDisplay("Test complete");

alert ( report );
Post Reply