Atata.WebDriverSetup 2.4.0 is released with Firefox version detection and new BrowserDetector class.
Changelog
Added
- Automatic detection of the installed version of the Firefox browser and determination of the corresponding driver version.
- Automatic detection of the installed version of the Edge browser on macOS and Linux.
- Add
BrowserDetector
static class for a detection of browser installations.
Changed
- Catch possible exceptions of
Registry.GetValue()
method call and returnnull
. - Catch possible exceptions of
FileVersionInfo.GetVersionInfo()
method call and returnnull
. - Update
AppVersionDetector.GetThroughOSXApplicationCli
method to handle possiblenull
result ofGetThroughCli
method. - Update
AppVersionDetector.GetThroughCli
method to trim result string. - Upgrade Atata.Cli package to v2.2.0.
BrowserDetector
BrowserDetector
- provides a set of static methods for a detection of browser installations.
Browser detection is supported for Chrome, Firefox and Edge,
so as a browser name the following constants can be used:
BrowserNames.Chrome
BrowserNames.Firefox
BrowserNames.Edge
BrowserDetector Methods
string GetInstalledBrowserVersion(string browserName)
Gets the installed browser version by the browser name.bool IsBrowserInstalled(string browserName)
Determines whether the browser with the specified name is installed.string GetFirstInstalledBrowserName(params string[] browserNames)
Gets the name of the first installed browser among thebrowserNames
.string GetFirstInstalledBrowserName(IEnumerable<string> browserNames)
Gets the name of the first installed browser among thebrowserNames
.
BrowserDetector Usage
Get First Installed Browser Name
string browserName = BrowserDetector.GetFirstInstalledBrowserName(
BrowserNames.Chrome,
BrowserNames.Firefox,
BrowserNames.Edge);
Is Browser Installed
bool isChromeInstalled = BrowserDetector.IsBrowserInstalled(BrowserNames.Chrome);
Get Installed Browser Version
string chromeVersion = BrowserDetector.GetInstalledBrowserVersion(BrowserNames.Chrome);