web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Click UI element works...
Power Automate
Suggested Answer

Click UI element works in one virtual machine but fails in another identical virtual machine

(1) ShareShare
ReportReport
Posted on by 2

Hi everyone!

I'm automating in a specific corporation page,  I'm using a simple selector for an "If window contains" action, then, if that exists I'm clicking it and doing some more clicks afterwards.

Around an hour ago I was testing it and it worked great! Then after trying it again a couple hours later it started failing. I tried selector testing and it says parent window could not be found, so I tried updating the window selector but after updating it, it still said "parent window could not be found".

After this happened I tried again in a clone of this virtual machine, same specs, configuration, everything. In this machine it worked fine, as it was working when I was trying it the first time.

Neither machine has been updated softwarewise, I'm using Chrome and it wasnt updated either.

 When I tried to update both the window selector and the selector itself, I noticed the parent window selector went from ":desktop > pane" to ":desktop > window" also, the new actual selector I tried gave me a lot more properties, but I could not test it as it is giving me the "parent window could not be found" error message.

I need a lead to what could the problem be and what could I do to fix it as I need this code working in multiple machines.

Thanks in advance! :)

Screenshot_3.png
I have the same question (0)
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,150 Super User 2026 Season 1 on at
    Hi,
     

    1. Use Window Title or Partial Matching

    Update the window selector to use "title:Contains" instead of "title:Equals", because window titles often change (e.g., with user/session/token info).

    Example:

    :desktop > window[title~='Corporation Portal']

    Instead of:

    :desktop > window[title='Corp Portal - Session 1234']

    You can also try:

    :desktop > window[class='Chrome_WidgetWin_1']

     2. Use Wildcards or Remove Fragile Attributes

    PAD selector editor sometimes includes very volatile properties like name, automationId, process, or index. These can change on every session.

     Instead, remove unstable attributes:

    • Open selector in Advanced Editor

    • Keep only the essentials like:

      • type, class, title, and explicit parent-child path

    • Avoid over-reliance on automationId unless it’s always static

     3. Re-capture with "UI Elements" Panel (Important!)

    Instead of using selectors alone:

    • Use “Add UI Element” from the UI Elements pane

    • Let PAD manage the selector's stability

    • Then use this element in your If window contains, Click, etc.

     Why? This gives you a portable, stable reference across machines and sessions.

     4. Ensure Browser is Attached Properly (for Chrome/Edge)

    If you're automating Chrome/Edge:

    • Use “Launch new Chrome” or “Attach to running Chrome instance”

    • Always launch the browser from within PAD if possible

    • This helps ensure window handles and process IDs are aligned

     5. Add Delay or Wait for Window

    If the error is intermittent:

    • Add a “Wait for window” action before you interact

    • Use Wait for window with title: "contains", timeout 10–15 seconds

    Sometimes the window is still loading when PAD starts looking for selectors.

     6. Test with Simplified Environment

    In your test VM where it works:

    • Capture both the working and failing selectors

    • Use the "Compare selectors" option to spot differences

    • Pay attention to:

      • processId

      • window class

      • automationId

      • control type  

    Then apply the more stable version in both machines.

     7. Use Image Recognition as a Last Resort (Fallback)

    If the selector issue persists and it's critical to proceed:

    • Use “Click image on screen” or “Wait for image”

    • Not ideal, but helpful when selectors become unreliable due to virtualization, streaming, or Electron apps

    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz

  • Suggested answer
    CU31080729-3 Profile Picture
    502 Moderator on at
    Hi,
     
    As per your question , i think you trying to automate window kind of application and window application having some selector is machine specific .
    if you select this machine specific element and when you move your flow to another machine its give error 
    so select and element which is not machine specific.
    1)  ":desktop > pane" to ":desktop > window"        for this selector you can try to remove "pane" and "window"
     
    used only specific element instead of more selected and then try its work 
     
     
    Thanks & Regards
    Chetan Ninghot
     
    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 582

#3
Haque Profile Picture

Haque 529

Last 30 days Overall leaderboard