selenium-webdriverinternet-explorermicrosoft-edgeelevated-privileges

IE Mode Edge driver stuck on 'This is the initial start page for the WebDriver server' when running in Elevated Mode (Admin Mode) [Selenium]


I am trying to run IE Mode on Edge. When the browser instance loads, it gets stuck on This is the initial start page for the WebDriver server

Selenium Version - 4.18.1

I am using the below args. when initializing the browser.

admin_ie_options = webdriver.IeOptions()
admin_ie_options.add_argument('--ie-mode-test')
admin_ie_options.add_argument('--no-sandbox')
admin_ie_options.add_argument("--ignore-zoom-setting")
admin_ie_options.add_argument("--ignore-protected-mode-settings")
admin_ie_options.add_argument('--disable-gpu')
admin_ie_options.add_argument('--disable-software-rasterizer')
admin_ie_options.add_argument('--disable-dev-shm-usage')
admin_ie_options.add_argument('--disable-extensions')

d = webdriver.Ie(options=admin_ie_options)
d.maximize_window()
d.get(url) #Any URL

NOTE: It works fine if, I am not running the browser in Admin Mode, however my use case needs the browser to run in Admin Mode.

P.S: I have tried the answers mentioned here, didn't work :( Selenium IE Webdriver stuck at "This is the initial start page for the WebDriver server." with IE11 IE driver 4.0.0 stuck at This is the initial start page for the WebDriver server

Edit1:

As @KendrickLi mentioned this is not possible to achieve currently. Refer -> (https://github.com/MicrosoftEdge/EdgeWebDriver/issues/87)


Solution

  • These 2 lines

    admin_ie_options.add_argument("--ignore-zoom-setting")
    admin_ie_options.add_argument("--ignore-protected-mode-settings")
    

    should be changed into

    admin_ie_options.ignore_protected_mode_settings = True
    admin_ie_options.ignore_zoom_level = True
    

    because they are not the valid arguments for Microsoft Edge.

    =================

    If the issue still occurs, you can simply replace the initial start page with your URL:

    admin_ie_options.initial_browser_url = 'url'
    

    and d.get(url) can be removed in this way.