Edit

Share via


"Failed to assume control of Microsoft Edge/Chrome/Firefox" error

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.

    1. To use web automation in your flows, select 'Get Extension' to download and install to the selected browser.
    2. After installing, be sure to enable the extension in the browser.

    Error message that contains a Get Extension button to install the web extension.

  • The web extension might seem to be installed and enabled in the extension repository of the specific browser, but it doesn't run.

Solution

  1. Install the respective web extension from the Power Automate for desktop designer.

    Illustration of how to install the web extension from the list.

  2. Even if the extension seems to be installed and enabled, remove and reinstall it.

  3. 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:

  1. Insert a new Launch Browser action as:

  2. 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.

      How to set up the parameters of the Launch new browser action.

  3. Insert an error handling policy:

    • Select the On error option in the action window.

      How to insert an error handling policy by using the On error option.

    • Open the Continue flow run dropdown list, select Go to next action, and then select Save.

      Illustration of how to select the Continue flow run and Go to next action options and then save the settings.

  4. 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.

      How to replace the new browser variable with the name of the variable produced in step 1.

  5. Select the On error option, and follow these steps:

    1. Enable the Retry action if an error occurs option.

      How to enable the Retry action if an error occurs option.

    2. Set the number of times to 20.

    3. Set the interval in seconds to 5.

    4. Select Save.

  6. 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.

      How to configure the parameters of the Go to web page action.

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.

  1. Insert a new Launch Browser action as:

  2. Set up the parameters of the action:

    • Launch mode: Launch new Instance

    • Initial URL: A default URL

    • Rest parameters can be set as desired.

      How to set up the parameters of the Launch new browser action.

  3. Insert an error handling policy:

    • Select the On error option in the action window.

      How to insert an error handling policy by using the On error option.

    • Open the Continue flow run dropdown list, select Go to next action, and then select Save.

      How to select the Continue flow run and Go to next action options and then save the settings.

  4. Insert a Wait action, and set its duration to 90 seconds (adjust duration as appropriate).

    How to insert a Wait action with value set to 90.

  5. 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.

      How to 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 ComSpec that has the value C:\WINDOWS\system32\cmd.exe exists on the computer.
  • (Chrome only) Check the exit_type parameter. If it's necessary, set the variable to normal at %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.