Use Loops in Forms

There are three Loop actions you can use in forms: Loop Field Values, For Each Option and For Each Radio Button. The three actions correspond to the three kinds of form controls for text input (INPUT elements with type "text" and TEXTAREA elements), options (SELECT elements) and radio buttons (INPUT elements with type "radio"). Watch the video below or read on to learn how to use these loops.

To loop over a form, you need to decide which form controls to loop over and in which order (this determines the order in which output values are generated). Next, insert a step for each with the loops with the corresponding Form action. This can be done by right-clicking the control in the Page view and choosing Loop > <form action> from the context menu, where <form action> is the appropriate action. For example, if the control is a text input control, you would choose Loop > Loop Field Values.

Every time a Loop Form action is executed, a value is changed in a form control element in the HTML page. This corresponds to what you would have done manually in a browser. If the form control has a JavaScript event attached to it, this event would be fired and some JavaScript executed. In some cases this JavaScript may change the form, such as the options of a SELECT element. In this case you must be careful and choose the right order in which to loop over the controls to ensure that the right options are available to the robot when it needs them. Normally, if you follow the order that you would use when doing this manually in a browser, it should work just fine.

Once all the Loop Form action steps have been inserted in the robot, you should add a step with a Click action that clicks one of the submit buttons of the form.