---
title: "focus-application"
sidebarTitle: "focus-application"
description: "Bring a specific application window to the foreground."
icon: "window-restore"
mode: "wide"
---

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