EdgeWebDriver icon indicating copy to clipboard operation
EdgeWebDriver copied to clipboard

An error occurred while initializing the browser: Message: session not created: Microsoft Edge failed to start: crashed.

Open Sahillather002 opened this issue 1 year ago • 5 comments

An error occurred while initializing the browser: Message: session not created: Microsoft Edge failed to start: crashed. (session not created: DevToolsActivePort file doesn't exist) (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so msedgedriver is assuming that msedge has crashed.) Stacktrace: GetHandleVerifier [0x00007FF62B6DF862+37938] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B679202+209490] (No symbol) [0x00007FF62B4C9BB7] (No symbol) [0x00007FF62B4F6A1A] (No symbol) [0x00007FF62B4F2CE6] (No symbol) [0x00007FF62B53136D] (No symbol) [0x00007FF62B527EA3] (No symbol) [0x00007FF62B5000BE] (No symbol) [0x00007FF62B4FEE0D] (No symbol) [0x00007FF62B4FFC71] Microsoft::Applications::Events::EventProperty::empty [0x00007FF62B85F944+888740] (No symbol) [0x00007FF62B5762FC] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF62B6059DC+36588] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF62B5FD8A5+3509] Microsoft::Applications::Events::EventProperty::empty [0x00007FF62B85E905+884581] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B6822C1+246545] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B67D674+227012] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B67D7AB+227323] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B6741E1+188977] BaseThreadInitThunk [0x00007FFF8A104CB0+16] RtlUserThreadStart [0x00007FFF8AC9E8AB+43]

Below is my referenced code:

# Declare the browser variable globally
global browser , browser_name , browser_version , platform_name


edge_driver_path = 'msedgedriver.exe'

# Create Edge options
edge_options = Options()

allTestCases=[]


def initialize_browser():
    global browser, browser_name, browser_version, platform_name
    crx_path = os.path.join(os.getcwd(), '1.7.8_0.crx')
    # Ensure the full path is used to avoid any path issues

    if os.path.exists(crx_path):
        print("File exists, proceeding to add to Edge.")
        try:
            edge_options.add_extension(crx_path)
            
            # Start Edge WebDriver service
            edge_service = Service(edge_driver_path)

            # Create Edge browser instance
            browser = webdriver.Edge(service=edge_service, options=edge_options)

            # Get browser and OS information
            browser_name = browser.capabilities.get('browserName', 'Not available')
            browser_version = browser.capabilities.get('browserVersion', 'Not available')
            platform_name = browser.capabilities.get('platformName', 'Not available')

            # Print browser and OS information
            print("Browser Name:", browser_name)
            print("Browser Version:", browser_version)
            print("Platform Name:", platform_name)
            print("Browser initialized successfully.")
        except Exception as e:
            print("An error occurred while initializing the browser:", str(e))
    else:
        print("File does not exist, check the path and permissions.")

Sahillather002 avatar Jun 19 '24 09:06 Sahillather002

Is there a solution for this yet?

gyuvaraj10 avatar Jul 17 '24 12:07 gyuvaraj10

Possible duplicate of #108

jbakeri4 avatar Jul 17 '24 14:07 jbakeri4

facing same

devfemibadmus avatar Jul 19 '24 14:07 devfemibadmus

An error occurred while initializing the browser: Message: session not created: Microsoft Edge failed to start: crashed. (session not created: DevToolsActivePort file doesn't exist) (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so msedgedriver is assuming that msedge has crashed.) Stacktrace: GetHandleVerifier [0x00007FF62B6DF862+37938] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B679202+209490] (No symbol) [0x00007FF62B4C9BB7] (No symbol) [0x00007FF62B4F6A1A] (No symbol) [0x00007FF62B4F2CE6] (No symbol) [0x00007FF62B53136D] (No symbol) [0x00007FF62B527EA3] (No symbol) [0x00007FF62B5000BE] (No symbol) [0x00007FF62B4FEE0D] (No symbol) [0x00007FF62B4FFC71] Microsoft::Applications::Events::EventProperty::empty [0x00007FF62B85F944+888740] (No symbol) [0x00007FF62B5762FC] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF62B6059DC+36588] Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF62B5FD8A5+3509] Microsoft::Applications::Events::EventProperty::empty [0x00007FF62B85E905+884581] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B6822C1+246545] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B67D674+227012] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B67D7AB+227323] Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF62B6741E1+188977] BaseThreadInitThunk [0x00007FFF8A104CB0+16] RtlUserThreadStart [0x00007FFF8AC9E8AB+43]

Below is my referenced code:

# Declare the browser variable globally
global browser , browser_name , browser_version , platform_name


edge_driver_path = 'msedgedriver.exe'

# Create Edge options
edge_options = Options()

allTestCases=[]


def initialize_browser():
    global browser, browser_name, browser_version, platform_name
    crx_path = os.path.join(os.getcwd(), '1.7.8_0.crx')
    # Ensure the full path is used to avoid any path issues

    if os.path.exists(crx_path):
        print("File exists, proceeding to add to Edge.")
        try:
            edge_options.add_extension(crx_path)
            
            # Start Edge WebDriver service
            edge_service = Service(edge_driver_path)

            # Create Edge browser instance
            browser = webdriver.Edge(service=edge_service, options=edge_options)

            # Get browser and OS information
            browser_name = browser.capabilities.get('browserName', 'Not available')
            browser_version = browser.capabilities.get('browserVersion', 'Not available')
            platform_name = browser.capabilities.get('platformName', 'Not available')

            # Print browser and OS information
            print("Browser Name:", browser_name)
            print("Browser Version:", browser_version)
            print("Platform Name:", platform_name)
            print("Browser initialized successfully.")
        except Exception as e:
            print("An error occurred while initializing the browser:", str(e))
    else:
        print("File does not exist, check the path and permissions.")

selenium? same bug after trying other driver

devfemibadmus avatar Jul 19 '24 14:07 devfemibadmus

fixed mine, i dont think its a bug with the webdriver........how i fix mine

I handle error every statement i made and i am able to see the bug caused by me

devfemibadmus avatar Jul 20 '24 08:07 devfemibadmus