'Getting WebDriverException error while using Edge browser in robotframework

I am getting the below error while using Edge as browser in my script (Chrome is working fine)

WebDriverException: Message: 'MicrosoftWebDriver.exe' executable needs to be in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687

I have already placed the webdrivers in the folders and updated the path in environment variable, already checked the version compatibility.



Solution 1:[1]

Issue was with the selenium version, Edge started working when I upgraded the Selenium Version > 4.

Solution 2:[2]

I test with the same version of Edge and Edge WebDriver and it works well with Robot Framework. You can refer to the following steps:

  1. Make sure the latest version of Python and Node.js have been installed in your computer.

  2. Install Browser library from PyPi with pip:

    pip install robotframework-browser
    
  3. Initialize the Browser library:

    rfbrowser init
    
  4. Install SeleniumLibrary:

    pip install robotframework-seleniumlibrary
    
  5. Download the corresponding version of Edge WebDriver from this page.

  6. Add the path of msedgedriver.exe to Environment Variables Path like below:

    enter image description here

  7. Edge.robot sample code:

    *** Settings ***
    Library   SeleniumLibrary
    
    *** Test Cases ***
    Example Test
        Open Browser  https://www.google.com  edge
    
  8. Navigate to the path of Edge.robot in cmd and run it to automate Edge:

    robot Edge.robot
    

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 Tina
Solution 2 Yu Zhou