在Selenium C#中移除Chromium Edge浏览器IE模式下的信息栏及解决意外关闭弹窗问题
Absolutely—since you're stuck using IEDriver (which can't send commands to the Edge browser shell), registry tweaks are the perfect workaround to suppress those persistent popups and info bars. Let’s break down targeted fixes for each issue you’re facing:
1. Disable the "Microsoft Edge Closed Unexpectedly" Crash Recovery Popup
This popup triggers when Edge detects an unexpected shutdown (super common in automated test environments). Here’s how to turn it off:
- Open the Registry Editor (
regedit.exe) as Administrator. - Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge- If the
Edgekey doesn’t exist, right-clickMicrosoft> New > Key, and name itEdge.
- If the
- Right-click the
Edgekey > New > DWORD (32-bit) Value. - Name it
RestoreOnStartupand set its value to0. - Add another DWORD value named
HideFirstRunExperienceand set it to1—this suppresses initial Edge setup prompts that might throw off your tests.
2. Suppress IE Mode Info Bars
The two info bars you’re seeing are likely compatibility or security prompts tied to IE Mode. Use these registry entries to block them:
Disable Compatibility View Info Bar
- Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main - Right-click
Main> New > String Value. - Name it
CompatibilityViewEnabledand set its value to0.
Disable Security & General IE Mode Info Bars
- Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Infobars- Create the
Infobarskey if it doesn’t exist.
- Create the
- Right-click
Infobars> New > DWORD (32-bit) Value. - Name it
AllowInformationBarand set its value to0. - This blocks most default info bars in IE Mode, including those for blocked content or security warnings.
Critical Notes
- Backup the Registry: Always export the relevant keys before making changes—this lets you revert if something goes wrong.
- Restart Everything: These changes won’t take effect until you close all Edge instances and restart your Selenium test runner.
- Global Impact: These tweaks apply to all Edge IE Mode sessions, not just your automated tests.
After applying these edits, run your tests again—those annoying popups and info bars should no longer interfere with your automation flow.
内容的提问来源于stack exchange,提问作者Shmulik b

