Set Value
Sets the value of a web element directly using JavaScript. This is faster than typing and bypasses input events, making it ideal for filling forms programmatically.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing the node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If Continue On Error property is true, no error is caught when the project is executed, even if the Catch node is used.
Input
- Browser ID - The browser session identifier from the Open Browser node.
- Selector - The XPath or CSS selector to locate the input element.
- Value - The value to set on the element via JavaScript.
Options
-
Selector Type - Type of selector used:
- XPath - Use XPath expression (default)
- CSS - Use CSS selector
-
Wait Timeout (sec) - Maximum time to wait for the element to appear. Default is 5 seconds.
Examples
Set Input Field Value
Browser ID: {{browser_id}}
Selector: //input[@name='email']
Value: user@example.com
Set Multiple Values Quickly
This is much faster than Type Text for bulk data entry:
Browser ID: {{browser_id}}
Selector: //input[@id='field1']
Value: {{data.field1}}
Set Hidden Input Value
Browser ID: {{browser_id}}
Selector: //input[@type='hidden'][@name='token']
Value: abc123xyz789
Clear Field (Set Empty Value)
Browser ID: {{browser_id}}
Selector: //input[@name='search']
Value: ""
Set Date Input
Browser ID: {{browser_id}}
Selector: //input[@type='date']
Value: 2024-12-31
When to Use Set Value vs Type Text
Use Set Value when:
- Speed is important (bulk data entry)
- Filling hidden fields
- The website doesn't validate input events
- Setting pre-formatted values (dates, numbers)
Use Type Text when:
- Website validates keystroke events
- Need to trigger onChange events
- Bot detection is present
- Human-like interaction is required
Tips
- Set Value is significantly faster than Type Text
- Does not trigger input events (onChange, onKeyPress, etc.)
- Works on hidden and disabled elements
- Use empty string "" to clear a field
- Combine with Click Element to trigger validation after setting value
Common Errors
- "Browser ID cannot be empty" - Connect to an Open Browser node
- "Selector cannot be empty" - Provide an XPath or CSS selector
- "Value cannot be empty" - Provide a value (use "" for empty string)
- "Element not found within X seconds" - The element doesn't exist or takes longer to load
- "Timeout cannot be empty" - Provide a timeout value
Related Nodes
- Type Text - Type text with human-like behavior
- Get Value - Retrieve element value
- Click Element - Click elements
- Send Keys - Send keyboard shortcuts