December 2015
Intermediate to advanced
192 pages
3h
English
CHAPTER 16
![]()
Browser Profile
Selenium WebDriver can start browser instances with various profile preferences, which can be quite useful. Obviously, some preference settings are browser specific, so you should take some time to explore. In this chapter, I cover some common usage.
Get browser type and version
Detecting browser type and version is useful to write custom test scripts for different browsers.
driver = new FirefoxDriver();ICapabilities caps = ((RemoteWebDriver)driver).Capabilities;String browserName = caps.BrowserName;String browserVersion = caps.Version;Console.WriteLine("browserName = " + browserName); // firefoxConsole.WriteLine("browserVersion ...
Read now
Unlock full access