This chapter provides a complete listing and reference for the methods in the OpenScript BrowserService Class of Browser Utility Module Application Programming Interface (API).
The following section provides an alphabetical listing of the methods in the OpenScript BrowserService API.
The following table lists the BrowserService API methods in alphabetical order.
Table 24-1 List of BrowserService Methods
Method | Description |
---|---|
Clear the browser. |
|
Closes the Browser. |
|
Closes all instances of the browser created by the current user including browser instances created outside of OpenScript. |
|
Gets the current browser. |
|
Gets the browser launch process id. |
|
Get the Chrome Utility to set credentials of the login dialog for the Chrome browser. |
|
Get the Firefox Utility to retrieve information about the Firefox browser. |
|
Get the MicrosoftEdge Utility to set auto-dismiss js dialog for the MicrosoftEdge browser. |
|
Gets the browser settings. |
|
Launch the browser specified in BrowserSettings.getBrowserType(). |
|
Sets the browser type. |
The following sections provide detailed reference information for each method and enum in the BrowserService Class of Browser Utility Module Application Programming Interface.
Closes all instances of the browser created by the current user including browser instances created outside of OpenScript.
This API will always try to terminate the browser process directly, so if you only need to close the browser launched by OpenScript, use browser.close() instead.
The browser.closeAllBrowsers method has the following command format(s):
browser.closeAllBrowsers( );
represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.
Get the Firefox Utility to retrieve information about the Firefox browser.
This utility is used to retrieve information, set Firefox preferences during playback, (for example, get a list of all installed extensions), or to disable popup windows during playback.
The browser.getFirefoxUtility method has the following command format(s):
browser.getFirefoxUtility( );
Launch the browser specified in BrowserSettings.getBrowserType().
The Browser will use any additional parameters specified in the BrowserSettings.getExtraParams()
setting. BrowserService will automatically determine the appropriate path for the specified browser type. If specified, BrowserSettings.getBrowserPathOverride() will be used for the browser path instead of the automatically determined path. If the BrowserService's browser is already running, launch() will do nothing.
represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.
Sets the browser type.
The browser.setBrowserType method has the following command format(s):
browser.setBrowserType(browserType);
BrowserType enum specifying the supported browser types. For example, BrowserType.InternetExplorer.
Sets the browser type.
//Specify Browser as Mozilla Firefox. browser.setBrowserType(BrowserType.Firefox); //Specify Browser as Internet Explorer. browser.setBrowserType(BrowserType.InternetExplorer); //Specify Browser as Chrome. browser.setBrowserType(BrowserType.Chrome); //Specify Browser as Microsoft Edge. browser.setBrowserType(BrowserType.MicrosoftEdge);