Forms
Retrieve or fill the value of a form element (input, select, checkbox, and radio).
Element Selector
Select the element and input using the element selector.
Selector Options
Choose the desired options.
Get form value
When selecting this option, you can retrieve the value from the form without performing actions to select or fill the form’s value.
Assign to Variable
You can assign the value to a variable.
- Variable Name: The name of the variable to assign the value. This field appears when you choose to assign to a variable.
Insert into Table
You can insert the value into a column in a table.
- Select Column: The column where the value is inserted. This field appears when you choose to insert into a table.
Text field
Fill text into text fields like <input>
and <textarea>
.
Value
The value you want to fill into the text field.
Clear Previous Value Before Filling
Clear the value of the text field element before inserting the new value.
Input Delay
Add a delay when inserting each character of the value. When set to 0, the value is inserted all at once.
Select
You can choose options such as:
Note
To use this option, you must verify that the element has a select option value
tag structure as shown in the image.
Value
The value of the element within the select tag.
The value to be filled here is the value of the value
attribute within the tag of that option. For example, if you want to select the 4 US
option, you need to input the value of the value
attribute, which is 4181830684
.
First Option
Select the first option in the list of options.
Last Option
Select the last option in the list of options.
Custom Order Option
Select an option by its custom order in the list of options.
Clear Previous Value Before Filling
Clear the value of the text field element before inserting the new value.
Checkbox
- Check/Uncheck: You can check or uncheck if it is already selected.
Radio
- Check/Uncheck: You can check or uncheck if it is already selected.
Practical Example
Here, I want to select the product options before adding to the cart.
First, I configure the Get Attribute
node to retrieve all values of the option
attribute from elements with the common selector [data-selector="listing-page-variations"]>div:nth-child(1) select option[value]
.
Normally, it only retrieves the value of the first element matching the selector. However, when I choose the Multiple
option, it can retrieve all values of all elements with the corresponding selector.
Then, I assign it to the variable values
. The values
variable will then be an array.
Next, I configure the Insert Data
node as follows:
The value assigned to the variable lengthV
uses an expression to calculate the number of elements in the values
variable, which contains the list of option values.
The value assigned to the variable lastValue
uses the subtract
function to calculate the index of the last value in the list of values in the values
variable.
The value assigned to the variable numValue
uses an expression to generate a random integer within the range from 1
to the value of lastValue
. I start from 1
because the first element in the array is empty, so it cannot be retrieved from index 0
.
Then, I connect to the Forms
node to fill the randomly retrieved value from the above node group and configure it as follows:
Similarly, I configure a node group to select a value for the second selection field, just like the first one.
The node group for selecting the two product options will look like this: