I'm trying to update my "chromedriver.exe" and my "msedgedriver.exe" when I start my program automatically. I am able to download both exes with their correct versions, but I need to acces to it's versions from my code and I'm having some trouble with edge.
In order to get my chromedriver.exe version I do:
//I get the new version
new DriverManager().SetUpDriver(new ChromeConfig());
ChromeDriver driver = new ChromeDriver();
try{
ICapabilities capabilities = driver.Capabilities;
string driver_version = (capabilities.GetCapability("chrome") as Dictionary<string, object>)["chromedriverVersion"].toString());
}
This works fine, it gets the chromedriver.exe version fine, the problem is when I try to do the same for my EdgeDriver. THe code is all the same, declaring EdgeDriver instead of ChromeDriver:
new DriverManager().SetUpDriver(new ChromeConfig());
EsgeDriverdriver driver = new EdgeDriver();
try{
ICapabilities capabilities = driver.Capabilities;
//this is where I cannot find the way of getting the version
string driver_version = (capabilities.GetCapability("edge") as Dictionary<string, object>)["edgedriverVersion"].toString());
}
I've tried with "edgeDriverVersion" and "msedgedriverVersion", but I can't find the correct way of doing it. I've searched for documentation online but haven't found anything so far. Thank You in advance.