Issue
I see a ICapabilities interface to get the Browser info;Did couple of googling with no luck for any code example; Can anybody please share anything how I can get the browser info for a particular IWebDriver instance ? I am using C# webdriver.
Solution
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;
Answered By - Yi Zeng
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.