Description

The focus-application command displays a specific application window to the foreground. This ensures that subsequent commands interact with the correct application during a test.

Arguments

ArgumentTypeDescription
namestringThe name of the application to focus. This should match the application’s display name.

Example usage

command: focus-application
name: Google Chrome

Protips

  • Ensure the application name matches the exact name displayed in your operating system’s task manager.
  • Use this command at the start of a test or before interacting with an application to avoid focus-related issues.
If the specified application isn’t running, the command will fail. Ensure the application is open before using this command. For example, to launch chrome try using the exec command:
- command: exec
  lang: pwsh
  code: start chrome

Notes

  • The focus-application command is useful for multi-application workflows where you need to switch between different apps during a test.