Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sahillather002 opened this issue Jun 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Sahillather002
Copy link

Sahillather002 commented Jun 19, 2024

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 Sahillather002 added the bug Something isn't working label Jun 19, 2024
@gyuvaraj10
Copy link

Is there a solution for this yet?

@jbakeri4
Copy link

Possible duplicate of #108

@devfemibadmus
Copy link

facing same

@devfemibadmus
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants