Focus Window

Verb: focusWindow

Focuses on a window, bringing it to the foreground.


focusWindow --window(Window)


Script Designer Required AcceptedTypes Description
--window Window Required Window Window that should be focused on.


The Launch and Attach Window command opens a Notepad window. Next, the Type Text command types the text "First open window" into the file. The process is repeated, but this time the Type Text command types the text "Second open window". Finally, the Focus Window command focuses on the window opened first.

defVar --name notepadWindow1 --type Window
defVar --name notepadWindow2 --type Window
launchWindow --executablepath "C:\\Windows\\notepad.exe" notepadWindow1=value
typeText --text "First open window!"
launchWindow --executablepath "C:\\Windows\\notepad.exe" notepadWindow2=value
typeText --text "Second open window!"
delay --timeout 00:00:02
focusWindow --window ${notepadWindow1}
delay --timeout 00:00:02
// Opens two Notepad windows, typing a text in each and focuses on the first.


Attention: If the window defined as a value in the Window parameter is not open, execution continues normally, the command just has no effect.

See Also

  • Attach Window
  • Cancel Token Source
  • Clear Cache
  • Click
  • Click on Cell
  • Click on Menu
  • Click on Value
  • Close Window
  • Control Screenshot
  • Count Windows
  • Expand Tree
  • Find Window
  • Find Windows
  • Focus
  • Get Barcode
  • Get Bounds
  • Get Cell Value
  • Get Control
  • Get Image Grid
  • Get Interval
  • Get Options
  • Get Table
  • Get Table Information
  • Get Tree Nodes
  • Get Value
  • Handle Open File Dialog
  • Handle Save File Dialog
  • Launch and Attach Window
  • Launch or Attach Window
  • Launch SAP Application
  • Map Image Grid
  • Maximize or Minimize Window
  • Offset Value
  • SAP Transaction
  • Screenshot Window
  • Select Row
  • Select Tab
  • Set Execution Throttling
  • Set Grid Value
  • Set Value
  • Update Window
  • Verify Enabled
  • Verify If Visible
  • Wait and Close Security Window
  • Wait Busy Window
  • Wait Control
  • Wait for Control to Enable
  • Wait for Window to Appear
  • Watch and Close Window
  • Watch and Select Client Certificate
  • Watch and Set Credentials in Browser