0

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
Defanci
  • 1
  • 2

1 Answers1

0

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...

chivracq
  • 667
  • 9
  • 24
  • Thank you chivracq. Sorry I know nothing about programing, would you be able to write the code for me? What I need is to submit the form in the shortest time when the form open. Can only submit once, no duplicate allow. Sometimes when I play macro few seconds earlier or form open few seconds late, I would get the Submit not found error because the form is still close. I then need to manually reclick the play button again and again till the form open. I would like the macro to auto replay again till the form is submitted. Btw, current macro is working fine after form opened. Thks again. – Defanci Mar 10 '22 at 12:22
  • Yeah well, then loop your Script with `!ERRORIGNORE` Activated like I already mentioned... // Nope, I don't (or rarely) write Code for other Users, all "Terms" I mentioned between Backtiks (Ex: `WAIT`) are iMacros Commands perfectly documented in the iMacros Wiki (+ with many Code Examples on the iMacros Forum)... – chivracq Mar 10 '22 at 12:35