'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://docs.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 1:[1]

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.

Solution 2:[2]

This should really be a comment and not a full answer (ridiculous reputation system tbh); Anyway, to add to Deepak-MSFT's answer - after adding the environment variables be sure to restart your IDE.

I added my MSEdge directory to the PATH and Eclipse would still complain. Everything worked after I closed and re-opened Eclipse.

Also check if you are pointing to MSEdge.exe or the directory where MSEdge.exe is located. I noticed that it only works if you point to the dir and not the .exe. So it would be something like: C:\Program Files (x86)\Microsoft\Edge Dev\Application\

Solution 3:[3]

I did face the same issue, and trust me I tried doing every possible thing, but you know what helped me, though it might sound lame to you, the Edge browser version it was old, when I updated it, it worked for me, the error was resolved, do give it a shot as well

Unlike Chrome browser it does not throws error lie the browser driver version and browser are incompatible.

Yours's sincerely, A frustrated Automation tester

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Deepak-MSFT
Solution 2 FatherlyNick
Solution 3 Pooja Thakur