How to get the Browser info in C# WebDriver?
In order to get info defined in ICapabilities interface, you need to cast IWebDriver instance to RemoteWebDriver
. Then you can get the info about BrowserName
, IsJavaScriptEnabled
, Platform
and Version
.
IWebDriver driver = new FirefoxDriver();
ICapabilities capabilities = ((RemoteWebDriver)driver).Capabilities;
// then you have
// capabilities.BrowserName;
// capabilities.IsJavaScriptEnabled;
// capabilities.Platform;
// capabilities.Version;