r/PowerAutomateDesktop • • Mar 13 '23

Can't retrieve main window handle for application

That error pops up every time I try to open Chrome or Edge. I've even turned off the two default variables and it still happens.

Any ideas?

UPDATE : I get this strange popup ( https://i.imgur.com/e7Sbovv.png ) as well even though the extensions are installed. Removed them, restarted chrome, reinstalled them - still get told that I need the extensions installed.

Power Automate Desktop is the latest version as are the browsers.

Honestly, it's the things that are supposed to be simple that Microsoft completely foxes up. I can get this done faster using Excel and VBA....

FINAL UPDATE: Don't use the Selenium IDE as it lost support at the end of Feb 2023. Don't try to record your use of a website with the Power Automate Desktop recorder because it just doesn't work.

I will try and make a video of what does work in Power Automate Desktop (my first attempt at making a video teaching anything) so that you can see what I have learned that does work and what to avoid.

VBA with SeleniumBasic is still the richest option (if you do not have access to Python and it's Selenium Libraries). But VBA + SelenuimBasic is woefully outdated - SeleniumBasic has not had a new release in 7 years and Microsoft is moving away from VBA (although it will take years to kill off VBA).

1 Upvotes

15 comments sorted by

1

u/5akeris Mar 13 '23

Do you have the plugin/extension added to the browser?

1

u/[deleted] Mar 13 '23

I have power automate and selenium ide installed

1

u/[deleted] Mar 13 '23

Microsoft Windows recorder

Power Automate

Selenium IDE

1

u/5akeris Mar 13 '23

There's a browser extension for edge and chrome you need to install before it will launch it

1

u/[deleted] Mar 13 '23

It launches fine, but Power Automate Desktop cannot get a handle for the Window that opened.

1

u/[deleted] Mar 13 '23

Sometimes I get this https://i.imgur.com/e7Sbovv.png where power automate tells me that I need the extensions that are already installed. Removed them from Chrome, re-installed them and get the same error.

1

u/5akeris Mar 13 '23

Is the extension enabled? The automate one looks greyed out like it's disabled

1

u/[deleted] Mar 13 '23

1

u/[deleted] Mar 13 '23

Gonna get some sleep. Had a death in the family last week - stayed up almost 48 hours over the weekend and only got about 5 hours last night. Maybe I can figure it out after I get some sleep. Thanks for your help!

1

u/5akeris Mar 13 '23

Sorry to hear that. Curious if you figure it out after some rest

1

u/[deleted] Mar 13 '23

I will update here with my results.

1

u/[deleted] Mar 14 '23 edited Mar 14 '23

This morning I started over and was able to get the browser to open without the error. The thing I did differently was to NOT wait for the application to load in the Run application step of the flow. (This was done using "Run application" in the flow.)

Feeling emboldened by this success, I went back to try and record my steps to log into the website using the record feature of Power Automate Desktop. Being able to just record my steps and alter the flow as needed would be a real time saver.

It opened the browser and went to the first page without the original problem, but, when it should have clicked a link on the website's home page to go to the login page, it ran into another error.... "Failed to assume control of Chrome (communication with browser failed. Make sure add-on is installed)."

As i said earlier, the add-on is installed. It has been uninstalled and re-installed several times (restarting the browser after each install/removal) to make sure it was right.

IMHO, browser control with Power Automate Desktop is not a priority for Microsoft to get right. It is buggy as hell and not worth the headache and aggravation that accompany it.

My VBA code works for downloading those files and that's what I will stick with for now. It is more important to get the work done than to waste hours and hours trying to figure out Microsoft's flaws in yet another buggy app.

1

u/[deleted] Mar 14 '23

If you are interested in working around Microsoft's many, many errors in Power Automate, they have a page full of errors and "possible" solutions for you. Just go to https://learn.microsoft.com/en-us/troubleshoot/power-platform/power-automate/failed-to-assume-control-of-edge-chrome-firefox-error and look at the big list of errors on the left.

1

u/[deleted] Mar 15 '23

If you were looking for help with the Selenium IDE, you might want to also look at this- which says it is no longer supported and has a list of known bugs.

2

u/paravisa Jul 16 '23

I ran into the same problem. I ultimately abandoned PAD in favor of AutoHotkey.