Defanci
Defanci

Reputation: 1

iMacros for Chrome: How to replay Macro if error occurred?

I have this simple 3 line macro to load a form and submit, sometime I get this "RuntimeError: element SPAN specified by TXT:Submit was not found, line: 3" how can I auto replay the macro? I would like to replay the macro until the form is submitted. I am using iMacros for Chrome Version 10.1.1, thank you.

SET !TIMEOUT_STEP 0
URL GOTO=https://docs.google.com/forms/......
TAG POS=2 TYPE=SPAN ATTR=TXT:Submit

Upvotes: 0

Views: 1170

Answers (1)

chivracq
chivracq

Reputation: 699

Yeah, well..., your !TIMEOUT_STEP (=0) is "(part of) the problem"...!

'Google' Docs/Forms are "known" to be pretty "heavy" Pages that take "some time" to load, (especially if you are the Owner/Editor of the Doc/Form), and even when the Browser "thinks" that the Page has fully loaded (and tells iMacros (after the URl GOTO), => "Go on, the Page has loaded, you can proceed with the rest of the Script"...), there is probably still some background JS Validation on the Page/Fields (Required Fields, Data Formatting, etc...), before that 'Submit' Button will appear or get Activated...

  • Use a longer Setting/Value for !TIMEOUT_STEP, => at least =1, but =3 or the Default =6 would also be OK and much more "reliable" than your =0...

  • And/or, add a mini-WAIT Statement after the URL GOTO.

  • And/or, add a mini-!PLAYBACKDELAY Statement at the beginning of the Sccript, or at least after the URL GOTO.

... Other Techniques are also available to "increase Reliability" (=> loop the Script with !ERRORIGNORE activated and conditionally abort it (with EXTRACT + EVAL() + MacroError()) when successful, set any of the 'Timeout' Options I mention conditionally, combined with extracting the "Result" after clicking on the 'Submit' Button, etc...), but they will all be "fighting" against your !TIMEOUT_STEP=0 which is too short...

Upvotes: 0

Related Questions