Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article provides guidance to resolve an error that might occur when you run a desktop flow that contains a Launch Browser action in Microsoft Power Automate.
Applies to: Power Automate
Original KB number: 5001691
Symptoms
When you run a desktop flow that has a Launch new Microsoft Edge, Launch new Chrome, or Launch new Firefox action in Microsoft Power Automate, the attempt fails. Additionally the program returns one of the following error messages:
-
Failed to assume control of Microsoft Edge (Internal error or communication failure).
-
Failed to assume control of Chrome (Internal error or communication failure).
-
Failed to assume control of Firefox (Internal error or communication failure).
Important
To resolve the error, run the Troubleshoot UI/Web automation issues diagnostic by using the Power Automate for desktop troubleshooter. When the diagnostic runs, it generates a report that identifies issues. Resolve these issues by pressing the Fix button that appears after the diagnostics check finishes. If the troubleshooter doesn't resolve the error, refer to the potential causes and solutions that are provided in this article.
Cause 1: Web extension isn't installed correctly or enabled
The Microsoft Edge, Google Chrome, or Firefox web extension isn't installed correctly or enabled.
Additional symptoms
Running a desktop flow by using one of the respective actions fails and returns an error message.
Web Recorder initiation for the specific browser shows the following message.
- To use web automation in your flows, select 'Get Extension' to download and install to the selected browser.
- After installing, be sure to enable the extension in the browser.
The web extension might seem to be installed and enabled in the extension repository of the specific browser, but it doesn't run.
Solution
Install the respective web extension from the Power Automate for desktop designer.
Even if the extension seems to be installed and enabled, remove and reinstall it.
Restart the browser.
Cause 2: Launch Browser action takes longer than the default timeout
Starting the browser takes longer than the Launch Browser action's default timeout. The automation process tries to assume control of the browser before it starts, causing the Launch Browser action to fail. This behavior might be inconsistent, where some executions fail while others are successful.
Solution 1: Increase timeouts
In the Launch new Edge, Launch new Chrome, or Launch new Firefox action, increase the values of the Timeout for webpage to load and Timeout parameters that are located in the Advanced section. For example, set these values to 120 seconds.
If this adjustment doesn't resolve the issue, try the steps in Solution 2 or Solution 3.
Solution 2: Use a Go to web page action
Use the Launch Browser action to start the process of the corresponding browser. Then, use a combination of an additional Launch Browser action that has the mode set to Attach to running instance and a Go to web page action:
Insert a new Launch Browser action as:
Set up the parameters of the action:
Launch mode: Launch new Instance
Initial URL: A default URL
The remaining parameters can be set as desired.
Insert an error handling policy:
Select the On error option in the action window.
Open the Continue flow run dropdown list, select Go to next action, and then select Save.
Insert a new Launch Browser action of the same browser as in step 1, and set up the parameters of the action:
Launch mode: Attach to running instance
Attach to browser tab: By URL
Tab URL: The URL inserted in step 1.
Variables produced: Replace the new browser variable with the name of the variable that was produced in step 1.
Select the On error option, and follow these steps:
Enable the Retry action if an error occurs option.
Set the number of times to 20.
Set the interval in seconds to 5.
Select Save.
Insert a Go to web page action and set up the parameters of the action:
Web browser instance: The variable produced by the Launch Browser action.
Navigate: To URL
URL: The target URL.
Solution 3: Use a Wait action
Use the Launch Browser action to start the process of the corresponding browser. Then, use a combination of an additional Launch Browser action that has the mode set to Attach to running instance and a Wait action that's set to a duration of 90 seconds.
Insert a new Launch Browser action as:
Set up the parameters of the action:
Launch mode: Launch new Instance
Initial URL: A default URL
Rest parameters can be set as desired.
Insert an error handling policy:
Select the On error option in the action window.
Open the Continue flow run dropdown list, select Go to next action, and then select Save.
Insert a Wait action, and set its duration to 90 seconds (adjust duration as appropriate).
Insert another Launch Browser action for the same browser that's used in step 1, and configure the parameters:
Launch mode: Attach to running instance
Attach to browser tab: By URL
Tab URL: The URL inserted in step 1.
Variables produced: Replace the new browser variable with the name of the variable produced in step 1.
Cause 3: Different user accounts for starting browser and running Power Automate for desktop
You start the browser by using a different system user than the one you use to run Power Automate for desktop (version 2.38 or higher). This issue can occur in attended and unattended desktop flow modes.
Solution
To resolve the issue, make sure you start the browser by using the same system user account that you use to run Power Automate for desktop.
Cause 4: Browser doesn't start because of profile conflicts
The browser doesn't start, or it starts one time but doesn't start in subsequent attempts. Running a desktop flow by using a Launch Browser action fails, and the browser either doesn't appear or terminates immediately after launch.
This issue can occur if another session is using the same browser profile. When you start a Chromium-based browser (such as Microsoft Edge or Google Chrome), the browser checks whether another instance is already using the same profile on disk. If it is, the browser terminates immediately. If the same user signs in to multiple sessions on the same machine, only one session can successfully start the browser; the other attempts terminate on startup.
Solution
To work around this issue, manually launch the browser from Power Automate for desktop by using a different profile on disk. Use the following example:
Folder.GetSpecialFolder SpecialFolder: Folder.SpecialFolder.DesktopDirectory SpecialFolderPath=> SpecialFolderPath
System.RunApplication.RunApplication ApplicationPath: $'''msedge.exe''' CommandLineArguments: $'''--user-data-dir=\"%SpecialFolderPath%\\<ProfileFolder>\"''' WindowStyle: System.ProcessWindowStyle.Normal
This command starts the browser by using a unique profile directory to prevent conflicts with other browser instances.
General checks
If the preceding actions don't resolve the issue, check the following items:
- Make sure that the environmental variable
ComSpecthat has the valueC:\WINDOWS\system32\cmd.exeexists on the computer. - (Chrome only) Check the
exit_typeparameter. If it's necessary, set the variable tonormalat %localappdata%\Google\Chrome\User Data\Default\Preferences. - Clear the browser cache and cookies manually, and then restart the browser.
WebDriver support
Starting in version 2.62, Power Automate for desktop supports WebDriver as an alternative communication method for browser automation. This approach eliminates the need to install a browser extension to enable web automation in Power Automate for Desktop.