Skip to main content
fixing formatting
Source Link
Lee Jensen
  • 2.3k
  • 1
  • 12
  • 24

public static string GetBrowserVersion() { string thisbrowserversion="";

public static string GetBrowserVersion() 
{ 
    string thisbrowserversion=""; 
    
    switch (ThisAppSettings.browserAppSetting.toLower())
    {
       case "chrome":
         thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("version").ToString(); 
         break;
       case "firefox":
         thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("browserVersion").ToString();
         break;
       default:
         // Throw exception stating unsupported browser

    }
    return thisbrowserversion; 
} 

}

public static string GetBrowserVersion() { string thisbrowserversion="";

switch (ThisAppSettings.browserAppSetting.toLower())
{
   case "chrome":
     thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("version").ToString(); 
     break;
   case "firefox":
     thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("browserVersion").ToString();
     break;
   default:
     // Throw exception stating unsupported browser

}
return thisbrowserversion; 

}

public static string GetBrowserVersion() 
{ 
    string thisbrowserversion=""; 
    
    switch (ThisAppSettings.browserAppSetting.toLower())
    {
       case "chrome":
         thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("version").ToString(); 
         break;
       case "firefox":
         thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("browserVersion").ToString();
         break;
       default:
         // Throw exception stating unsupported browser

    }
    return thisbrowserversion; 
} 
Source Link

public static string GetBrowserVersion() { string thisbrowserversion="";

switch (ThisAppSettings.browserAppSetting.toLower())
{
   case "chrome":
     thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("version").ToString(); 
     break;
   case "firefox":
     thisbrowserversion = ((RemoteWebDriver)thisbrowser).Capabilities.GetCapability("browserVersion").ToString();
     break;
   default:
     // Throw exception stating unsupported browser

}
return thisbrowserversion; 

}