MS Edge Chromium hangs while running through selenium webdriver

Rajesh Sivadasan 1 Reputation point

Getting the below messages before the the launched browser hangs:

DevTools listening on ws://
[5580:2732:0220/] Failed to launch GPU process.
Traceback (most recent call last):
File "d:\python.vscode\", line 10, in <module>
driver = Edge(executable_path=edge_driver_path)
File "D:\Python39\lib\site-packages\msedge\selenium_tools\", line 103, in init
File "D:\Python39\lib\site-packages\selenium\webdriver\remote\", line 157, in init
self.start_session(capabilities, browser_profile)
File "D:\Python39\lib\site-packages\selenium\webdriver\remote\", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "D:\Python39\lib\site-packages\selenium\webdriver\remote\", line 321, in execute
File "D:\Python39\lib\site-packages\selenium\webdriver\remote\", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created
from disconnected: received Inspector.detached event
(Session info: MicrosoftEdge=88.0.705.74)

Below is the python code that I am using to call edge:

from selenium import webdriver
from msedge.selenium_tools import Edge
strURL = r''
edge_driver_path = r"D:\Python\msedgedriver.exe"
driver = Edge(executable_path=edge_driver_path)
driver.implicitly_wait(300) # 5 minutes 

MS Edge version is : Version 88.0.705.74 (Official build) (64-bit)
The edge driver version is also the same.
Running on Windows 10 enterprise version

Python Version is 3.9.0 64 bit

Unable to make edge selenium webdriver based programs run. This keeps on breaking now and then.

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,234 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deepak-MSFT 2,191 Reputation points Microsoft Vendor

    @Rajesh Sivadasan ,
    I suggest you try to make a test with the sample code below. I have tested it with the MS Edge version 88.0.705.74 and it works fine.

    Python Selenium code:

    from msedge.selenium_tools import Edge, EdgeOptions  
    options = EdgeOptions()  
    options.use_chromium = True  
    options.binary_location = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"  
    driver = Edge(executable_path = r"Edge_driver_path_here....", options = options) # Modify the path here...  
    driver.get("http://Your_website_here...")  # Modify the URL here...  

    Further, you can try to modify the code example as per your own requirements.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments