Search code examples
seleniumselenium-webdriverwebdrivermicrosoft-edgechromium

How to use Edge Chromium webdriver "unknown error: cannot find MSEdge binary"


I am trying to use the WebDriver for the Edge Chromium version with PostMan, but I cannot make it work.

WebDriver Download: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Doc: https://learn.microsoft.com/en-us/microsoft-edge/webdriver

I try to add the Edge Chromium and Webdriver in the system PATH environment variable and no difference. I think the selenium implementation in java work with the Edge Chromium Webdriver

msedgedriver.exe --port 9515

POST localhost:9515/session

{
   "capabilities":{
      "firstMatch":[
         {

         }
      ],
      "alwaysMatch":{
         "browserName":"MicrosoftEdge",
         "platformName":"windows",
         "goog:chromeOptions":{
            "extensions":[

            ],
            "args":[

            ]
         }
      }
   },
   "desiredCapabilities":{
      "browserName":"MicrosoftEdge",
      "version":"",
      "platform":"WINDOWS",
      "goog:chromeOptions":{
         "extensions":[

         ],
         "args":[

         ]
      }
   }
}
{
    "value": {
        "error": "unknown error",
        "message": "unknown error: cannot find MSEdge binary",
        "stacktrace": 
"Backtrace:\n\tOrdinal0 [0x00007FF6678D7C52+1932370]\n\tOrdinal0 
[0x00007FF66783CDA2+1297826]\n\tOrdinal0 
[0x00007FF6677A0A51+658001]\n\tOrdinal0 [0x00007FF667710F1F+69407]\n\tOrdinal0 
[0x00007FF66770EF02+61186]\n\tOrdinal0 [0x00007FF667737DBD+228797]\n\tOrdinal0 
[0x00007FF6677351AF+217519]\n\tOrdinal0 [0x00007FF66771706F+94319]\n\tOrdinal0 
[0x00007FF66771822E+98862]\n\tOrdinal0 
[0x00007FF66785B531+1422641]\n\tGetHandleVerifier 
[0x00007FF6679991E9+656297]\n\tGetHandleVerifier 
[0x00007FF667998F81+655681]\n\tGetHandleVerifier 
[0x00007FF6679A104C+688652]\n\tGetHandleVerifier 
[0x00007FF6679999C3+658307]\n\tOrdinal0 
[0x00007FF66785177E+1382270]\n\tOrdinal0 
[0x00007FF66785D9D6+1432022]\n\tOrdinal0 
[0x00007FF66785C84D+1427533]\n\tBaseThreadInitThunk 
[0x00007FF909056FD4+20]\n\tRtlUserThreadStart [0x00007FF90AB5B1F1+33]\n"
    }
}

The WebDriver should open and be able to execute other commands


Solution

  • I suggest you to refer steps below may help to solve the issue.

    (1) First try to set the environment variable for your Edge (chromium) application.

    (2) Try to open PowerShell window and try to launch the Edge web driver.

    (3) Launch the Postman app and try to use http://localhost:9515/session as POST request.

    (4) Add code below as body of the request.

    {
        "desiredCapabilities": {
                "nativeEvents": false,
                "browserName": "edg",
                "version": "",
                "platform": "ANY",
                "javascriptEnabled": true,
                "takesScreenshot": true,
                "handlesAlerts": true,
                "databaseEnabled": true,
                "locationContextEnabled": true,
                "applicationCacheEnabled": false,
                "browserConnectionEnabled": true,
                "cssSelectorsEnabled": true,
                "webStorageEnabled": true,
                "rotatable": true
        }
    }
    

    (5) Try to send the request.

    Reference:

    SeleniumHQ/selenium

    Notes:

    • Your environment variable should properly set and referenced to your Edge (chromium) correctly.

    • Use the supported version of Edge web driver with your Edge (chromium) browser.