Sets the current browser type.
This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.
OldBrowserType = SetBrowserType (NewBrowserType [,hMachine])
Variable | Description |
---|---|
OldBrowserType | The previous browser type. BROWSERTYPE. |
NewBrowserType | The new browser type. BROWSERTYPE or NULL. |
hMachine | Optional: Machine on which to set the browser type. Default is the current machine. HMACHINE. |
SetBrowserType sets the current browser type on the current machine or on a specified machine to NewBrowserType or NULL (no browser) and returns the previous browser type. SetBrowserType does not change the value set for Default Browser in Runtime Options.
Assume Internet Explorer 7.0 is the current browser when the following code is run:
BROWSERTYPE btOldType btOldType = SetBrowserType (explorer8_0) Print ("Old type: {btOldType}") Print ("New type: {GetBrowserType()}") // Result: // Old type: Internet Explorer 7.0 // New type: Internet Explorer 8.0