close ui window.md

Close UI Window

The Close UI Window block is used to close a desktop application window as part of a desktop UI automation flow. If no window input is provided, the block closes the last active window; if a window handle is supplied, it closes that specific window instead.

Fully expanded, the Close UI Window block shows the following properties:

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Close UI Window onto the canvas.

  2. Connect it in the flow and set the basic parameters you need, such as Close method, Close timeout, Default timeout, and (optionally) Window.

  3. Run the flow when it's ready; the block will attempt to close the chosen window and branch on Close timeout if the window does not close in time.

Building block parameters

Parameters

This timeout is specific to the block. Each case also has a separate global timeout configured in the Settings panel; if the case runs longer than that global timeout, it is automatically cancelled regardless of this block's timeout.

Resources

Topic Description
Flows FAQ Common questions about creating, running, and managing flows in Leapwork.
Flows Troubleshooting Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.
Strategy Editor Guidelines for understanding and using the Strategy Editor in Leapwork to define, refine, and validate robust locator strategies for UI elements using DOM structure, tokens, and wildcards.