Skip to content

Commit 046b715

Browse files
committed
Wrong UI element is clicked or populated in desktop flow
1 parent fd61ea3 commit 046b715

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Wrong UI element is clicked or populated in desktop flow
3+
description: Resolves an issue where Power Automate for desktop clicks or populates the wrong UI element instead of the captured element due to application focus handling.
4+
ms.reviewer: nimoutzo
5+
ms.author: iomimtso
6+
ms.date: 2025-11-26
7+
ms.custom: sap:Desktop flows\UI or browser automation
8+
---
9+
# Wrong UI element is clicked or populated in desktop flow
10+
11+
This article provides a resolution for an issue where Power Automate for desktop interacts with the wrong UI element instead of the element you captured during flow design even though the Test Selector tool detects the right element.
12+
13+
## Symptoms
14+
15+
When you run a desktop flow that includes UI automation actions such as **Click UI element in window** or **Populate text field in window**, the flow interacts with a different UI element than the one you originally captured.
16+
17+
You might observe the following:
18+
19+
- The action executes without errors but targets an unexpected element
20+
- The wrong element receives the click or text input during runtime
21+
- The **Test Selector** tool successfully identifies the correct element during design time
22+
23+
## Cause
24+
25+
This issue occurs when the target application handles focus or enable/disable events in an unexpected manner. Some applications dynamically change element focus or states, which can cause UI automation actions to interact with the wrong element.
26+
27+
## Resolution
28+
29+
To resolve this issue, use a combination of UI automation and Mouse and keyboard actions to ensure proper element targeting. Choose the appropriate method based on whether you need to click or populate text.
30+
31+
### Click an element using hover and mouse click
32+
33+
Instead of using the **Click UI element in window** action alone, use this sequence:
34+
35+
1. Add a **Hover mouse over UI element in window** action and select the target UI element.
36+
2. Add a **Send mouse click** action immediately after to click the element.
37+
38+
This approach ensures the element receives focus through the hover action before the click is sent, preventing focus-related issues.
39+
40+
### Populate a text field using focus and send keys
41+
42+
Instead of using the **Populate text field in window** action alone, use this sequence:
43+
44+
1. Add a **Focus text field in window** action and select the target text field.
45+
2. Add a **Send keys** action to input the desired text.
46+
47+
This approach explicitly sets focus to the correct text field before sending keystrokes, ensuring text is entered in the intended field.

0 commit comments

Comments
 (0)