|
2 | 2 | title: Failed to assume control of Edge or Chrome or Firefox error |
3 | 3 | description: Provides a resolution to the error that occurs when running a desktop flow that has a "Launch browser" action in Power Automate. |
4 | 4 | ms.reviewer: nimoutzo, jefernn |
5 | | -ms.date: 05/24/2023 |
| 5 | +ms.date: 04/09/2025 |
6 | 6 | ms.custom: sap:Desktop flows\UI or browser automation |
7 | 7 | --- |
8 | 8 | # "Failed to assume control of Microsoft Edge/Chrome/Firefox" error |
9 | 9 |
|
10 | | -This article provides a resolution for the error that may 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](browser-automation-error-after-chromium-update.md). |
| 10 | +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](browser-automation-error-after-chromium-update.md). |
11 | 11 |
|
12 | 12 | _Applies to:_ Power Automate |
13 | 13 | _Original KB number:_ 5001691 |
14 | 14 |
|
15 | 15 | ## Symptoms |
16 | 16 |
|
17 | | -When you run a desktop flow that has a "Launch Edge", "Launch Chrome", or "Launch Firefox" action in Microsoft Power Automate, the execution fails with one of the following error messages: |
| 17 | +### Scenario 1 |
18 | 18 |
|
19 | | -> Failed to assume control of Microsoft Edge (Internal error or communication failure). |
| 19 | +When you run a desktop flow that has a [Launch new Microsoft Edge](/power-automate/desktop-flows/actions-reference/webautomation#launch-new-microsoft-edge), [Launch new Chrome](/power-automate/desktop-flows/actions-reference/webautomation#launchchromebase), or [Launch new Firefox](/power-automate/desktop-flows/actions-reference/webautomation#launchfirefoxbase) action in Microsoft Power Automate, the execution fails with one of the following error messages: |
20 | 20 |
|
21 | | -> Failed to assume control of Chrome (Internal error or communication failure). |
| 21 | +- > Failed to assume control of Microsoft Edge (Internal error or communication failure). |
| 22 | +- > Failed to assume control of Chrome (Internal error or communication failure). |
| 23 | +- > Failed to assume control of Firefox (Internal error or communication failure) |
22 | 24 |
|
23 | | -> Failed to assume control of Firefox (Internal error or communication failure) |
| 25 | +> [!IMPORTANT] |
| 26 | +> To resolve the error: |
| 27 | +> |
| 28 | +> 1. First run the **Troubleshoot UI/Web automation issues** diagnostic using the [Power Automate for desktop troubleshooter](/power-automate/desktop-flows/troubleshooter). |
| 29 | +> 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. |
| 30 | +> 3. If the troubleshooter doesn't resolve the error, proceed to the potential causes and resolutions provided in this article. |
| 31 | +
|
| 32 | +### Scenario 2 |
| 33 | + |
| 34 | +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](#cause-3-the-browser-is-launched-using-a-different-system-user-than-the-one-used-to-run-power-automate-for-desktop-version-238-or-higher) in this article. |
24 | 35 |
|
25 | 36 | ## Cause 1: Web extension isn't installed properly or enabled |
26 | 37 |
|
27 | 38 | The Microsoft Edge, Google Chrome, or Firefox web extension isn't installed properly or enabled. |
28 | 39 |
|
29 | | -## Verifying issue for cause 1 |
| 40 | +### Verifying issue for cause 1 |
30 | 41 |
|
31 | 42 | - Execution of a desktop flow with one of the respective actions fails with the error message. |
32 | | -- Web Recorder initiation for the specific browser shows the below message: |
| 43 | +- Web Recorder initiation for the specific browser shows the following message: |
33 | 44 |
|
34 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/you-need-power-automate-desktop-extension.png" alt-text="A message that contains a Get Extension button to install the web extension."::: |
| 45 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/you-need-power-automate-desktop-extension.png" alt-text="Screenshot that shows a message containing a Get Extension button to install the web extension."::: |
35 | 46 |
|
36 | | -- Note that the web extension might seem to be installed and enabled in the extension repository of the specific browser but the execution to be unsuccessful. |
| 47 | +- The web extension might seem to be installed and enabled in the extension repository of the specific browser, but it fails to execute. |
37 | 48 |
|
38 | 49 | ### Resolution |
39 | 50 |
|
40 | 51 | 1. Install the respective web extension from the Power Automate for desktop designer. |
41 | 52 |
|
42 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/browser-extensions.png" alt-text="Select to install the web extension from the list."::: |
| 53 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/browser-extensions.png" alt-text="Screenshot that shows how to install the web extension from the list."::: |
43 | 54 |
|
44 | 55 | 2. Even if the extension seems installed and enabled, you need to remove it and reinstall it. |
45 | 56 | 3. Restart the browser. |
46 | 57 |
|
47 | | -## Cause 2: Launch browser action takes longer than the default timeout |
| 58 | +## Cause 2: Launch Browser action takes longer than the default timeout |
48 | 59 |
|
49 | | -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. |
| 60 | +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. |
50 | 61 |
|
51 | | -## Verifying issue for cause 2 |
| 62 | +### Verifying issue for cause 2 |
52 | 63 |
|
53 | 64 | 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). |
54 | 65 |
|
55 | | -### Resolution |
| 66 | +### Resolution 1 |
| 67 | + |
| 68 | +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. |
| 69 | + |
| 70 | +If this adjustment doesn't resolve the issue, follow the steps outlined in [Resolution 2](#resolution-2) or [Resolution 3](#resolution-3). |
56 | 71 |
|
57 | | -1. Insert a new "Launch new browser" action as: |
58 | | - - Launch new Edge |
59 | | - - Launch new Chrome |
60 | | - - Launch new Firefox |
61 | | - - Launch new Internet Explorer |
| 72 | +### Resolution 2 |
| 73 | + |
| 74 | +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](/power-automate/desktop-flows/actions-reference/webautomation#gotowebpagebase) action afterwards can be used to resolve the issue. |
| 75 | + |
| 76 | +1. Insert a new Launch Browser action as: |
| 77 | + - **Launch new Microsoft Edge** |
| 78 | + - **Launch new Chrome** |
| 79 | + - **Launch new Firefox** |
| 80 | + - **Launch new Internet Explorer** |
62 | 81 |
|
63 | 82 | 2. Set up the parameters of the action: |
64 | 83 | - Launch mode: Launch new Instance |
65 | 84 | - Initial URL: A default URL |
66 | | - - Rest parameters can be set as desired. |
| 85 | + - The remaining parameters can be set as desired. |
67 | 86 |
|
68 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/parameters-of-launch-new-browser-action.png" alt-text="Set up the parameters of the Launch new browser action."::: |
| 87 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/parameters-of-launch-new-browser-action.png" alt-text="Screenshot that shows how to set up the parameters of the Launch new browser action."::: |
69 | 88 |
|
70 | | -3. Insert an error handling policy by: |
| 89 | +3. Insert an error handling policy: |
71 | 90 | - Select the **On error** option in the action window: |
72 | 91 |
|
73 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/insert-error-handling-policy-for-action.png" alt-text="Insert an error handling policy by using the On error option."::: |
| 92 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/insert-error-handling-policy-for-action.png" alt-text="Screenshot that shows how to insert an error handling policy by using the On error option."::: |
74 | 93 |
|
75 | 94 | - Select **Continue flow run** > **Go to next action** in the dropdown list, and then select **Save**. |
76 | 95 |
|
77 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/save-settings-on-error.png" alt-text="Select the Continue flow run and Go to next action options and then save the settings."::: |
| 96 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/save-settings-on-error.png" alt-text="Screenshot that shows how to select the Continue flow run and Go to next action options and then save the settings."::: |
78 | 97 |
|
79 | | -4. Insert a new "Launch new browser" action of the same browser as step 1 and set up the parameters of the action: |
| 98 | +4. Insert a new Launch Browser action of the same browser as step 1 and set up the parameters of the action: |
80 | 99 | - Launch mode: Attach to running instance |
81 | 100 | - Attach to browser tab: By URL |
82 | 101 | - Tab URL: The URL inserted in step 1. |
83 | | - - Variables produced: Replace the new Browser to variable to the name of the variable produced by step 1. |
| 102 | + - Variables produced: Replace the new browser variable with the name of the variable produced in step 1. |
84 | 103 |
|
85 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/replace-variables-produced-browser.png" alt-text="Replace the new Browser to variable to the name of the variable produced by step 1."::: |
| 104 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/replace-variables-produced-browser.png" alt-text="Screenshot that shows how to replace the new browser variable with the name of the variable produced in step 1."::: |
86 | 105 |
|
87 | 106 | 5. Select the **On error** option and take the following steps: |
88 | 107 | 1. Enable the **Retry action if an error occurs** option. |
89 | 108 |
|
90 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/enable-retry-action-if-an-error-occurs.png" alt-text="Enable the Retry action if an error occurs option."::: |
| 109 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/enable-retry-action-if-an-error-occurs.png" alt-text="Screenshot that shows how to enable the Retry action if an error occurs option."::: |
91 | 110 |
|
92 | 111 | 2. Set the number of times to **20** by selecting the number of times. |
93 | 112 | 3. Set the interval in seconds to **5** by selecting the number of seconds. |
94 | 113 | 4. Select **Save**. |
95 | 114 |
|
96 | | -6. Insert a "Go to Web page" action and set up the parameters of the action: |
97 | | - - Web browser instance: The variable produced by the "Launch new browser" action. |
| 115 | +6. Insert a **Go to web page** action and set up the parameters of the action: |
| 116 | + - Web browser instance: The variable produced by the Launch Browser action. |
98 | 117 | - Navigate: To URL |
99 | 118 | - URL: The URL you would like to navigate to. |
100 | 119 |
|
101 | | - :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/select-parameters-in-go-to-web-page.png" alt-text="Configure the parameters of the Go to Web page action."::: |
| 120 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/select-parameters-in-go-to-web-page.png" alt-text="Screenshot that shows how to configure the parameters of the Go to web page action."::: |
| 121 | + |
| 122 | +### Resolution 3 |
| 123 | + |
| 124 | +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. |
| 125 | + |
| 126 | +1. Insert a new Launch Browser action as: |
| 127 | + - **Launch new Microsoft Edge** |
| 128 | + - **Launch new Chrome** |
| 129 | + - **Launch new Firefox** |
| 130 | + - **Launch new Internet Explorer** |
| 131 | + |
| 132 | +2. Set up the parameters of the action: |
| 133 | + - Launch mode: Launch new Instance |
| 134 | + - Initial URL: A default URL |
| 135 | + - Rest parameters can be set as desired. |
| 136 | + |
| 137 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/parameters-of-launch-new-browser-action.png" alt-text="Screenshot that shows how to set up the parameters of the Launch new browser action."::: |
| 138 | + |
| 139 | +3. Insert an error handling policy: |
| 140 | + - Select the **On error** option in the action window: |
| 141 | + |
| 142 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/insert-error-handling-policy-for-action.png" alt-text="Screenshot that shows how to insert an error handling policy by using the On error option."::: |
| 143 | + |
| 144 | + - Select **Continue flow run** > **Go to next action** in the dropdown list, and then select **Save**. |
| 145 | + |
| 146 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/save-settings-on-error.png" alt-text="Screenshot that shows how to select the Continue flow run and Go to next action options and then save the settings."::: |
| 147 | + |
| 148 | +4. Insert a **Wait** action and set its duration to **90** seconds (adjust duration as needed). |
| 149 | + |
| 150 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/wait-action.png" alt-text="Screenshot that shows how to insert a Wait action with value set to 90."::: |
| 151 | + |
| 152 | +5. Insert another Launch Browser action for the same browser used in step 1, and configure the parameters: |
| 153 | + - Launch mode: Attach to running instance |
| 154 | + - Attach to browser tab: By URL |
| 155 | + - Tab URL: The URL inserted in step 1. |
| 156 | + - Variables produced: Replace the new browser variable with the name of the variable produced in step 1. |
| 157 | + |
| 158 | + :::image type="content" source="media/failed-to-assume-control-of-edge-chrome-firefox-error/replace-variables-produced-browser.png" alt-text="Screenshot that shows how to replace the new browser variable with the name of the variable produced in step 1."::: |
| 159 | + |
| 160 | +## 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) |
| 161 | + |
| 162 | +This issue can occur in attended and unattended desktop flow modes. |
| 163 | + |
| 164 | +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. |
| 165 | + |
| 166 | +## General checks |
102 | 167 |
|
103 | | -Finally, find some general checks that you may apply in case the above actions don't fix the issue: |
| 168 | +If the preceding actions don't resolve the issue, ensure the following: |
104 | 169 |
|
105 | 170 | - Make sure that the environmental variable `ComSpec` with value `C:\WINDOWS\system32\cmd.exe` exists on the machine. |
106 | | -- Only for Chrome: Check and set the `exit_type` parameter to `normal` at _%localappdata%\Google\Chrome\User Data\Default\Preferences_. |
107 | | -- Clear the cache and cookies from the browser manually and restart the browser. |
| 171 | +- (Chrome only) Check and set the `exit_type` parameter to `normal` at _%localappdata%\Google\Chrome\User Data\Default\Preferences_. |
| 172 | +- Clear the browser cache and cookies manually, and then restart the browser. |
0 commit comments