Block reference / Web interaction
Forms
Fill a text field, choose a dropdown option, or tick a checkbox or radio button.
Only in
WarpX Browser
Forms sets the value of a form control. Text fields and dropdowns are filled through the profile's browser with human-paced typing and pointer movement by default; checkboxes and radio buttons are set directly in the page. With Get form value it reads a field's current value instead, for any kind of field, and leaves the field as it is.
Settings
- Element Selector
The element to act on, as a CSS selector or an XPath; anything starting with
/,(,@orid(is read as XPath, and it can hold a reference such as{{variables.selector}}. The crosshair button (Select an element) lets you pick the element in the profile's browser, including inside iframes and shadow roots, and the check button (Verify selector) tests what you typed.Exampleinput[name="email"]- Multiple
Fills every matching element instead of only the first. With Get form value, reads every match and returns a list of values.
ExampleUnchecked- Mark elementwhen the selector is CSS
Tags each element the block fills or reads, and skips tagged ones the next time this block runs, so a loop over
input.qtyfills the next untouched field on each pass. Works for every Form type and with Get form value. The tag is the attributeblock--plus the block's id, so it is gone once the page reloads or changes; only offered for CSS selectors.ExampleUnchecked- Wait for selector
Waits, up to Selector timeout (ms), for the field to appear before filling or reading it. Use it for forms that render after the page loads.
ExampleChecked- Selector timeout (ms)when Wait for selector is on
How long Wait for selector keeps looking, in milliseconds. The default is
5000.Example8000- Get form value
Reads the field's current value instead of setting it: what is typed in a text field or text area, the chosen option's
valuein a dropdown, or a checkbox's or radio button'svalue. The field is left as it is; nothing is typed or clicked, so Human Emulation does not apply, and Form type and the settings under it are hidden.ExampleUnchecked- Assign to variablewhen Get form value is on
Also stores the result in a workflow variable. With Multiple on, the variable holds the whole list.
ExampleChecked- Variable namewhen Get form value is on, Assign to variable is on
The variable to write. Later blocks read it as
{{variables.currentEmail}}; start the name with$push:to append to a list instead of replacing it.ExamplecurrentEmail- Insert to tablewhen Get form value is on
Writes the result into the workflow's table. With Multiple on, each match becomes its own row, unless the column's type is array.
ExampleChecked- Select columnwhen Get form value is on, Insert to table is on
The table column to write to. Later blocks read the first row as
{{table.email}}and the last as{{table.$last.email}}; if you pick none, the value goes into a column namedcolumn.Exampleemail- Form typewhen Get form value is off
The kind of control: Text field (inputs and text areas), Select (dropdowns), Checkbox or Radio.
ExampleText field- Selectedwhen Form type is Checkbox or Radio
On ticks the checkbox or radio button; off unticks it. The change is made in the page and the page's change events fire.
ExampleChecked- Select an option bywhen Form type is Select
The value picks the option that matches Value. First option and Last option pick by place in the list, whatever the options say, and Custom picks the option at Option position.
ExampleThe value- Valuewhen Form type is Text field, or Select with The value
The text to type, or for a dropdown the option to choose, matched against the option's value or its visible text. It can hold references such as
{{variables.email}}or{{table.email}}.Example{{variables.email}}- Clear form valuewhen Form type is Text field, or Select with The value
For a text field, empties it before typing; off, the text is typed into the field without clearing it first. For a dropdown it has no effect.
ExampleChecked- Option positionwhen Form type is Select and Select an option by is Custom
The position of the option to choose, counting from 1. A number past the end picks the last option, and one below 1 picks the first.
Example2- Human Emulationwhen Form type is Text field or Select
On (the default), clicks into the field and types with human-paced keystrokes and pauses, or clicks the dropdown open before choosing. Off, the value is set at once.
ExampleChecked- Typing delay (ms per character)when Form type is Text field and Human Emulation is off
The pause between keystrokes when Human Emulation is off.
0puts the whole value in at once; a higher number presses the keys one by one with that pause.Example0- Delay time (ms)
A pause after the block finishes, before the next block starts. Write one number such as
1000, or a range such as1000,3000to pick a random pause in that range on each run.Example300,800
Every block also has the shared block settings — a description, Disable block and what to do on an error, and Finding elements explains selectors in more depth. Fields that take text accept data from earlier blocks.
What it hands on
When setting a value, nothing is written to the table or to variables. With Get form value, the field's value goes to the chosen column and variable, as text; an empty field gives empty text. With Multiple it is a list with one value per match, and each value becomes its own table row unless the column's type is array. The block leaves by its single output; if no element matches, it fails.
Example: Sign in with an email and password
- Start
- New tab
- Forms
- Forms
- Click element
- Add a New tab block that opens the sign-in page, for example
https://app.example.com/login. - Add a Forms block with Element Selector
input[name="email"]and tick Wait for selector. - Leave Form type on Text field, set Value to
{{variables.email}}, and keep Clear form value and Human Emulation on. - Add a second Forms block for
input[type="password"]with Value{{variables.password}}. - Add a Click element block for
button[type="submit"]to send the form.
Good to know
- If no element matches, the block fails with an error that names the selector, and the workflow stops. Set On error in the block's settings to Continue flow or Execute fallback to carry on.
- To check what a field holds before you change it, use one Forms block with Get form value into a variable, then a second Forms block to fill it. Reading never changes the field.
- For a checkbox, Get form value returns the element's
value(oftenon), not whether it is ticked. Use Attribute value withcheckedto gettrueorfalse. - Of the typing blocks, only Forms types at a human pace. Type text and Press key send keys without Human Emulation.
See also
- Type text — Put text into an input, textarea or editable element.
- Press key — Send a key, or a string of keys, to an element or to whatever has focus.
- Click element — Click an element on the page, with human-like mouse movement by default.
- Attribute value — Read or set an HTML attribute on an element, such as a link's
hrefor an image'ssrc.