> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# focus-application

> Bring a specific application window to the foreground.

## 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

| Argument | Type     | Description                                                                             |
| -------- | -------- | --------------------------------------------------------------------------------------- |
| `name`   | `string` | The name of the application to focus. This should match the application's display name. |

## Example usage

```yaml theme={null}
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.

<Note>
  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:

  ```yaml theme={null}
  - command: exec
    lang: pwsh
    code: start chrome
  ```
</Note>

## Notes

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