Edit

Share via


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

This article provides a resolution for the error that might occur when you run a desktop flow that contains a Launch Browser action in Microsoft Power Automate. If the error occurs right after a browser update and has the same symptoms, see Browser automation actions stop working after a browser update.

Applies to:   Power Automate
Original KB number:   5001691

Symptoms

Scenario 1

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 execution fails with 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:

  1. First run the Troubleshoot UI/Web automation issues diagnostic using the Power Automate for desktop troubleshooter.
  2. When the diagnostic runs, a report is generated that identifies issues. These issues can be resolved by pressing the Fix button that appears after the diagnostics check completes.
  3. If the troubleshooter doesn't resolve the error, proceed to the potential causes and resolutions provided in this article.

Scenario 2

The error also occurs when you run a Launch Browser action, and the browser is launched using a different system user than the one used to run Power Automate for desktop. For the recommended workaround, see Cause 3 in this article.

Cause 1: Web extension isn't installed properly or enabled

The Microsoft Edge, Google Chrome, or Firefox web extension isn't installed properly or enabled.

Verifying issue for cause 1

  • Execution of a desktop flow with one of the respective actions fails with the error message.

  • Web Recorder initiation for the specific browser shows the following message:

    Screenshot that shows a message containing 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 fails to execute.

Resolution

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

    Screenshot that shows how to install the web extension from the list.

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

  3. Restart the browser.

Cause 2: Launch Browser action takes longer than the default timeout

Launch of the browser takes longer than the default timeout (30 seconds) of the action. The automation tries to assume control of the browser before opening and as a result the Launch Browser action fails.

Verifying issue for cause 2

Execution of a desktop flow with one of the respective actions fails with the error message. This behavior might not be consistent (some executions could be successful).

Resolution 1

In the Launch new Edge, Launch new Chrome, or Launch new Firefox action, increase the values of Timeout on webpage load and Timeout parameters located in the Advanced section. For example, set these values to 120 seconds.

If this adjustment doesn't resolve the issue, follow the steps outlined in Resolution 2 or Resolution 3.

Resolution 2

Use the Launch Browser action to start the process of the corresponding browser. Then a combination of an additional Launch Browser action with mode set to Attach to running instance and a Go to web page action afterwards can be used to resolve the issue.

  1. Insert a new Launch Browser action as:

    • Launch new Microsoft Edge
    • Launch new Chrome
    • Launch new Firefox
    • Launch new Internet Explorer
  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.

      Screenshot that shows 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:

      Screenshot that shows how to insert an error handling policy by using the On error option.

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

      Screenshot that shows 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 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 produced in step 1.

      Screenshot that shows how to replace the new browser variable with the name of the variable produced in step 1.

  5. Select the On error option and take the following steps:

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

      Screenshot that shows how to enable the Retry action if an error occurs option.

    2. Set the number of times to 20 by selecting the number of times.

    3. Set the interval in seconds to 5 by selecting the number of seconds.

    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 URL you would like to navigate to.

      Screenshot that shows how to configure the parameters of the Go to web page action.

Resolution 3

Use the Launch Browser action to start the process of the corresponding browser. Then a combination of an additional Launch Browser action with mode set to Attach to running instance and a Wait action set to a duration afterwards can be used to resolve the issue.

  1. Insert a new Launch Browser action as:

    • Launch new Microsoft Edge
    • Launch new Chrome
    • Launch new Firefox
    • Launch new Internet Explorer
  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.

      Screenshot that shows 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:

      Screenshot that shows how to insert an error handling policy by using the On error option.

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

      Screenshot that shows 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 needed).

    Screenshot that shows how to insert a Wait action with value set to 90.

  5. Insert another Launch Browser action for the same browser 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.

      Screenshot that shows how to replace the new browser variable with the name of the variable produced in step 1.

Cause 3: The browser is launched using a different system user than the one used to run Power Automate for desktop (version 2.38 or higher)

This issue can occur in attended and unattended desktop flow modes.

To resolve the issue, ensure that the browser is launched using the same system user account that's being used to run Power Automate for desktop.

General checks

If the preceding actions don't resolve the issue, ensure the following:

  • Make sure that the environmental variable ComSpec with value C:\WINDOWS\system32\cmd.exe exists on the machine.
  • (Chrome only) Check and set the exit_type parameter to normal at %localappdata%\Google\Chrome\User Data\Default\Preferences.
  • Clear the browser cache and cookies manually, and then restart the browser.