OSVersion Property (.NET)

 

Type: String

 

OSVersion returns the version number, as a string, of the user's operating system.  Examples of the OSVersion string for OS X users include "10.6.8" and "10.7.2". Note that Windows also has version numbers which represent the OS type, such as XP, Vista or Windows 8.

 

Tip: See Detecting Operating System Details for examples of the possible values returned by this property.

 

This is the extended property version of OSVersion. In general, we recommend only obtaining the OSVersion property using the basic version (not performing an extended property test for this property). The basic property check is instantaneous, whereas the extended property check requires BrowserHawk to use Java to perform this test which is much slower in comparison. There are two cases, however, where using the extended property version of these properties has an advantage when it comes to testing OS X users: 1) With Firefox on OS X the basic version of OSVersion will only return the version in x.y format, such as "10.7" and not "10.7.2", and 2) With Opera version 10 and earlier on OS X, no OSVersion information is available with the basic property version.  If these cases are very important to you, use the extended property version. Otherwise the basic version will provide the same results, but much faster.

 

Note: Tthe OSVersion property is returned as a string. For  numeric comparisons, such as checking to see if a version is greater than a certain version, you may find BrowserHawk's CompareVersion helper function useful.

 

Special notes for this property:

 

Note: Use of this property requires the Enterprise Edition of BrowserHawk.

 

C# Example:

<%

ExtendedOptions options = new ExtendedOptions();

options.AddProperties("OSVersion");

ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);

%>

<html>OSVersion is: <% Response.Write(extBrow.OSVersion);  %>

</html>

 

 

See Also:

Detecting Operating System Details

Additional Steps Required for Java based properties  (for extended property testing only)

OSName Property (.NET)

OSDetails Property (.NET)

CompareVersions Method (.NET)