How to detect installed Edge version, to automate download of correct webdriver version?

SimonV 1 Reputation point
2021-01-25T15:30:11.943+00:00

Edge webdriver versions are tied to Edge versions. webdriver v87 <=> edge v87, etc.
In a large team environment not everyone will be upgraded to v88 at the same time, so I need a way to detect the version of Edge that is installed so the automation scripts can download the correct version of the Edge webdriver.

How to detect the version of Edge installed (Win10 and MAC) so that the correct webdriver version can be used?

Microsoft Edge Microsoft Edge development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2021-01-25T15:56:08.303+00:00

    Sounds like you're using Selenium. This is actually a problem with all browsers. For whatever reason webdrivers really want to lockstep with browsers which makes upgrading difficult. In most cases it is recommended that your test agents run a fixed browser version and your tests can be configured appropriately.

    To determine the version of Edge just look at the major version of the binary that is installed, note that a user may have multiple versions of edge (beta and release for example) IIRC. The challenge is that there may not be a version of the driver for the version of the browser you have. For example I'm running 88.0.705.00 of Edge. That makes the version v88. What is not clear to me is whether you can mix the versions of v88 webdriver or not as Edge has a separate version for each released version it appears.

    0 comments No comments

  2. Anonymous
    2021-01-26T05:52:01.527+00:00

    @SimonV ,
    If you are looking for a way to get the version of the Edge browser using Selenium then you can try to refer to the examples below.

    C# code to find Edge browser version:

    var options = new EdgeOptions();  
    options.UseChromium = true;  
    options.BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";   // Here add the Edge browser exe path.  
    var driver = new EdgeDriver(@"Your_web_driver_path_here...", options); // Here modify the selenium web driver path.  
    driver.Navigate().GoToUrl("https://Your_website_address_here...");  
    Console.WriteLine("MS Edge version: " + driver.Capabilities["browserVersion"]);  
    

    Python code to find Edge browser version:

    import time  
    from selenium import webdriver  
    from selenium.webdriver.edge.options import Options  
      
    option = Options()  
    option.set_capability("useAutomationExtension", "false")    
    option.binary_location = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"    #Here add the Edge browser exe path.  
    driver = webdriver.Edge(executable_path=r'Your_web_driver_path_here...\msedgedriver.exe', capabilities= option.to_capabilities())    #Here modify the selenium web driver path.  
    print("*******************")  
    print("Edge browser version: " + driver.capabilities['browserVersion'])  
    print("*******************")  
    driver.get("https://Your_website_address_here...")  
    

    If you are using any other developing language then you can try to convert the above code examples to that language.

    If you want to find the Edge version by checking the registry keys then you can try to check at the below location.

    Registry path: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Edge\BLBeacon, Key name: version.

    60521-231.png

    Here is another registry key to check the Edge browser version:

    Registry path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062} , Key name: pv.

    60522-232.png

    You can also detect the Edge version from User-Agent String.

    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.50.

    You can notice the Edge browser version at the end of the User-Agent string.

    You can try to choose a suitable way to detect the Edge browser version.

    Thanks for your understanding.

    ----------

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.