Error and Return Codes
iMacros displays an error message if it encounters an error and stops the current macro run (unless SET !ERRORIGNORE YES is used).
The general rule is:
- Success return code greater than 0 (Currently there is only one success code: 1)
- Failure return code less than 0
- The code is sent via the Scripting Interface or command line interface. You can use this return code to find out whether a macro succeeded or not.
- With iimGetLastError() the text of an error message can be retrieved via the Scripting Interface.
- These error codes should not be confused with the Scripting Interface Return Codes which are between -1 and -100.
|-101||Aborted: User pressed the Stop button in the iMacros sidebar. Typically, you can check this value to see if the user wants to exit the application.|
|-102||Browser Closed: User pressed the Window Close button in the browser.
iMacros error codes are in the range between -1000 and -2000.
|-1000||Unspecified: Macro playback returned an error without explicitly specifying an error code.|
|-1010||Not In Playback Mode: Error occurred while macro playback is not active (recording or idle mode).|
|-1020||Unsupported Browser: Unsupported web browser was specified for the macro playback engine.|
|-1030||Browser Not Initialized: Browser type not yet determined.|
|-1040||Tabbed Browsing Disabled: Attempt to run the TAB command while IE tabbed browsing is disabled.|
|-1100||Load Failed: Failed to load the macro (syntax or I/O error) (Found wrong macro command while loading file).|
|-1110||Invalid Macro Name: Invalid macro name specified for playback (Command Line Error: No Macro found).|
|-1200||Bad Parameter: Invalid macro parameter was specified.|
|-1210||Cannot Compile Regex: Cannot compile regular expression (as in SEARCH).|
|-1220||Wrong Decryption Password: Incorrect decryption password supplied. Please enter the correct password in the OPTIONS dialog or re-run the macro.|
|-1230||File Not Found: Filename specified in the macro command (e.g. IMAGESEARCH) doesn't exist.|
|-1235||File Access Denied: Access to the file was denied by the system, or the file might be in use.|
|-1240||Invalid Record Index: The data source record with requested index does not exist.|
|-1250||JScript Error: JScript parsing/evaluation error (in EVAL).|
|-1300||Html Element Not Found: Cannot find HTML element.|
|-1310||Non Expected Tag Found: HTML element was found when EVENT:FAIL_IF_FOUND was specified (see TAG).|
|-1320||Search Query Not Found: Search query not found in source.|
|-1330||Page or Download Timeout: !TIMEOUT_PAGE was reached before the page finished loading or !TIMEOUT_DOWNLOAD was reached before a file download completed.|
|-1340||Eval Error: Custom MacroError thrown by EVAL|
|-1350||Navigation Error: page load returned HTTP Status between 400 and 500 or the server could not be connected.|
|-1360||Security Problem: a security problem occurred and ONSECURITDIALOG or ONINSECURECONNECTION was set to CONTINUE=NO.|
|-1400||Dialog Manager Error: Indicates that an exception has occurred in Dialog Manager.|
|-1410||No Download Detected: Macro contains ONDOWNLOAD, but no download dialog was detected.|
|-1420||Checksum or Size Not Verified: Checksum or Size of downloaded file does not match specified.|
|-1430||Failed To Handle Browser Dialog: Failed to handle Web Browser dialog.|
|-1440||Failed To Set Save File Name: Failed to set filename in the Save File dialog.|
|-1450||No Dialog Handler: The Dialog Manager detected a dialog, but the handler for this dialog type is not enabled. Missing command ON...DIALOG. (Only from Scripting Interface)|
|-1500||Command Not Supported: The command or feature is not licensed or supported in this product.|
|-1600||Invalid Stopwatch Id: Invalid Stopwatch ID or LABEL specified, duplicate or nonexistent.|
|-1610||Stopwatch Already Running: Stopwatch with this ID or label is already running.|
|-1620||Stopwatch Not Started: Cannot stop stopwatch before it's started.|
|-1700||Invalid Select Content: Selected entry in a select box is not available.|
|-1710||Invalid Check Radio Content: Invalid CONTENT parameter specified for check or radio box.|
|-1750||Cannot Save Element Screenshot: Element does not support save element screenshot.|
|-1800||Image Not Found: Could not find image with given confidence in browser screen.|
|-1810||Image Recognition Internal Error: Internal Error in Image Recognition Plugin (Is it properly installed?).|
|-1820||Cannot Load Image: Image file could not be loaded.|
|-1830||Illegal Imagesearch Subregion: ImageSearch subregion is either not completely contained in the source image, or smaller than search image, or not a rectangle.|
|-1840||ImageSearch Not Enough Memory: ImageSearch failed to allocate enough memory to open image file.|
|-1900||Document Null: Failed to run a command because no page has been opened in the web browser or could not retrieve the page source (document is null).|
|-1910||Invalid Target Window: Cannot locate target web browser window or frame.|
|-1930||Macro Timeout: TIMEOUT_MACRO was reached before the macro finished playing.|
|-2000||Set Proxy Error: Unable to set proxy server settings.|
Firefox Error Codes
Errors specific for the Firefox Add-on.
|-802||Timeout error (failed to load web page)|
|-804||ONDOWNLOAD command was used but no download occurred|
|-902||Image search library not found|
|-903||Internal error in image library|
|-911||Bad parameter value for the command|
|-912||Unsupported command (e. g. DS)|
|-920||Element for specified x/y coordinates was not found|
|-921||Element specified by TAG command was not found|
|-922||Frame specified in TAG command was not found|
|-923||Element or its ancestors have no href (src) attribute, applies to SAVEAS command|
|-924||Number of options in select box element has been exceeded|
|-925||Select box has no specified options|
|-926||Source code of web page doesn't match SEARCH query|
|-927||Image specified in IMAGESEARCH command was not found|
|-930||File not found (e.g. for imacros://run?m=non_existent.iim or URL GOTO=file://...)|
|-931||Could not access file|
|-932||Specified folder was not found or could not be accessed|
|-933||Network error while file or page loading|
|-934||Specified checksum doesn't match calculated|
|-941||Password decryption failed|
|Data Source Errors|
|-951||DATASOURCE_LINE exceeds actual number of rows in data source file|
|-952||Data source file can not be parsed|
|-953||Attempt to access non-existing column in data source file|
|Time Watch Errors|
|-961||Attempt to set already existing time watch|
|-962||Specified time watch does not exist|
|-971||Specified tab number does not exists (tabs counted from the tab where replay started)|
|-981||Syntax error in XPath expression|
|-982||XPath expression resulted into multiple nodes|
|-983||Syntax error in regular expression|
|-990||Non Expected Tag Found: HTML element was found when EVENT:FAIL_IF_FOUND was specified|
Chrome Error Codes
Errors specific for the Chrome Add-on.
|-602||Page load timeout|
|-603||Macro replaying timeout|
|-610||Internal error: proxy module is not available (unlikely to happen, was introduced to handle cases when a user had Chrome version where module was not yet supported)|
|-612||No content loaded in the active tab (some commands require content page to work)|
|-660||File IO interface is not installed (some commands require it to work)|
|-701||Internal error in handling image files (should never happen, may occur in case of some internal Chrome bug or an attmept to crash browser)|
|-702||Image search library not found (corresponding message host was not installed)|
|-703||Internal error in image search library|
|-711||Wrong parameter value for a command|
|-721||Element not found|
|-722||Frame not found|
|-723||Element or its ancestors have no href (src) attribute, applies to SAVEAS command|
|-724||Number of options in select box element has been exceeded|
|-725||Select box has no specified options|
|-726||Source code of web page doesn't match SEARCH query|
|-727||Image specified in IMAGESEARCH command was not found|
|-730||File not found|
|-731||Error writing to a file|
|-732||Specified folder was not found or could not be accessed|
|-733||Network error error (e.g. server name unresolved or network connection broken in the middle of transfer)|
|-734||Wrong credentials for HTTP authorization (specified in ONLOGIN command)|
|-751||DATASOURCE_LINE exceeds actual number of rows in data source file|
|-752||Data source file can not be parsed|
|-753||Attempt to access non-existing column in data source file|
|-761||Attempt to set already existing time watch|
|-762||Specified time watch does not exist|
|-771||Specified tab number does not exists (tabs counted from the tab where replay started)|
|-781||Syntax error in XPath expression|
|-782||XPath expression resulted into multiple nodes|
|-790||Non Expected Tag Found: HTML element was found when EVENT:FAIL_IF_FOUND was specified|
Scripting Interface Return Codes
After each command the Scripting Interface returns a code. You can use this return code to find out whether a command succeeded or not. The general rule is:
- Success return code greater equal 0
- Failure return code less than 0
- You can use iimGetErrorText to retrieve the text associated with the last error.
- 1 (sOk)
- Command (iimMethod()) completed Ok
- -1 (sFail)
- Scripting Interface can not complete this command. Typically this error can occur if the software is not installed correctly
- -2 (sNotCompleted)
- A command was started but did not complete. This error happens only if the browser is terminated so abruptly that iMacros can not respond back to the interface. Typically this happens only in the rare case of a browser crash. If the user simply closes the browser you will get the -102 error instead (see below).
- -3 (sTimeout)
- The iMacros browser did not respond in a certain time. The default iimPlay timeout is 600s (other commands have different timeout default, see each command). You can change this value individually for some commands. For example, you can specify iimPlay(<macro>, <timeout>). In addition to a normal timeout, this error also occurs if the browser freezes for any reason. (In the trial version this error can also occur if you do not press the iMacros trial version reminder screen "Continue" button in time. This issue can never occur in the full version.)
- -4 (sNotStarted)
- Could not start the iMacros browser. iimOpen failed and the subsequent commands cannot proceed.
- -5 (sWrongPath)
- A wrong path (not existent or not accessible) was specified in iimTakBrowserScreenshot()
- -6 (sRunnerNotReachable)
- -7 (sInstancesCountLimitReached)
- -8 (sProfileMissing)
- A profile (iMacros for Firefox) or user-data-dir (iMacros for Chrome) is necessary to run iMacros via iimRunner. The correct syntax is iimOpen("-fx -fxProfile MyProfile") or iimOpen("-cr -crUserdataDir MyDataDir")
- -9 (sTCPInterfaceLoadFailed)
- -10 (sSystemLockedNoDesktop)
- iimTakeBrowserScreenshot() did not find a desktop.
- -11 (sInternalVariable)
- iimSet tried to set an internal or built-in variable. Value is going to be null.
- This error occurs if you start iimOpen twice.
- When automating Firefox or Chrome using iMacros Trial Version. The trial box hasn't been clicked in 20 seconds.
- -100...-2000 (sMacroError)
- sMacroError can have a value of -100 and lower (-101,-102,...,-2000). These are NOT Scripting Interface error codes, but errors created by the iMacros browser and the macro itself. The Scripting Interface passes them from the browser to your script or application.
- User pressed Stop button in the iMacros Browser. Typically, you can check on this value to see if the user wants to exit the application.
- User pressed Exit button in the iMacros Browser, i.e. the iMacros Browser was closed by a user. Note that this is not the same as sNotComplete. The code "sNotComplete"(-2) indicates that he browser was closed e.g. by the task scheduler or a crash and not by a regular user exit or stop.
- Error codes generated by iMacros version 6 and older during the macro replay.
- iMacros for Firefox macro replay error codes.
- Playback errors generated by iMacros 7. These are the same errors (or error codes) that you get during a manual macro replay (if you start the macro by clicking the "Play" button). For more information on these errors please see the List of iMacros Browser Error Codes.