Skip to main content

Focus

Sets focus on a web element, making it the active element for keyboard input.

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 element to focus.

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

Focus Input Field

Browser ID: {{browser_id}}
Selector: //input[@name='username']

Focus Before Typing

Combine with Send Keys for reliable keyboard input:

1. Focus node:
Browser ID: {{browser_id}}
Selector: //textarea[@id='comment']

2. Send Keys node:
Browser ID: {{browser_id}}
Selector: //textarea[@id='comment']
Key Modifier1: Control
Key: a

Focus to Trigger Events

Some websites trigger events when an element receives focus:

Browser ID: {{browser_id}}
Selector: //input[@class='autocomplete']

Tips

  • Use Focus before Send Keys to ensure keyboard input goes to the right element
  • Some form fields trigger validation or autocomplete when focused
  • Focus is automatically set when using Click Element or Type Text
  • Useful for keyboard navigation workflows

Common Errors

  • "Browser ID cannot be empty" - Connect to an Open Browser node
  • "Selector cannot be empty" - Provide an XPath or CSS selector
  • "Element not found within X seconds" - The element doesn't exist or takes longer to load
  • "Timeout cannot be empty" - Provide a timeout value