Skip to main content

Switch Window

Switches to another browser window or tab by matching the window title with a regex pattern.

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.
  • Window Name - Title of the window to switch to. Supports regex patterns for flexible matching (not required when Next Window is enabled).

Options

  • Next Window - Switch to the next window in the list instead of matching by name. Default is false.

Examples

Switch by Exact Title

Browser ID: {{browser_id}}
Window Name: Dashboard - MyApp
Next Window: false

Switch by Partial Title (Regex)

Browser ID: {{browser_id}}
Window Name: .*Dashboard.*
Next Window: false

Switch to Next Window

Browser ID: {{browser_id}}
Next Window: true

Handle Popup Window

1. Click Element (opens popup):
Browser ID: {{browser_id}}
Selector: //button[@id='open-popup']

2. Switch Window:
Browser ID: {{browser_id}}
Window Name: Login.*

3. Type Text (in popup):
Browser ID: {{browser_id}}
Selector: //input[@name='username']
Text: myusername

4. Switch Window (back to main):
Browser ID: {{browser_id}}
Window Name: Main Page

Cycle Through All Windows

Loop through all windows:
1. Switch Window (next):
Browser ID: {{browser_id}}
Next Window: true

2. Get Title:
Browser ID: {{browser_id}}
Output: {{title}}

3. Process window based on {{title}}

Regex Pattern Examples

  • Exact match: ^Dashboard$
  • Contains: .*Dashboard.*
  • Starts with: ^Login.*
  • Ends with: .*- Google Chrome$
  • Multiple options: (Dashboard|Settings|Profile)

Tips

  • Window Name supports regular expressions for flexible matching
  • Use List Windows to see all available window titles
  • Next Window cycles through windows in order
  • Browser remembers which window is active after switching
  • Use Get Title to verify you switched to the correct window
  • Switching doesn't close or affect other windows

Common Errors

  • "Browser ID cannot be empty" - Connect to an Open Browser node
  • "Window Name is required or Next Window must be enabled" - Provide a window title or enable 'Next Window'
  • "Window with title matching 'X' not found" - No window matches the pattern. Verify the title or pattern
  • "Browser session not found" - Ensure the Open Browser node has run successfully
  • "Current window not found in window list" - The browser state may have changed