FindBrowser - web automation method
Connects a web automation Browser to an existing instance of Internet Explorer object ( IWebBrowser2 ) that verifies a list of Search Conditions.
Applies to:
- Core
var b = coreObj.FindBrowser(Search conditions);
Arguments:
-
This method accepts a variable number of Search Condition arguments.
The following attributes are accepted in search conditions:
-
TITLE
condition on the title of the browser window
-
URL
condition on the url of the web page
-
APP
the name of the application hosting the Internet Explorer web control
Remarks:
-
The method returns a web automation Browser object that matches the search condition arguments and gets programmatic control over the IWebBrowser2 underlying IE native object.
If no browser verifies the search conditions, then null is returned.
In case of an error the method throws a web macro exception and the lastError property of the core object is set as follows:
The time allocated for search is specified by the searchTimeout property.
APP attribute is case insensitive. The default value is iexplore.exe and * stands for any application (including IE).
This IE automation method works for all Internet Explorer versions: IE6, IE7, IE8, IE9 and with IE protected mode on Windows XP, Vista and Win7.
Example:
var coreObj = new ActiveXObject("OpenTwebst.Core");
var browser = coreObj.FindBrowser("URL=http://www.codecentrix.com/");
// If the browser is found then close it.
if (browser != null)
{
browser.Close();
}
See also:
- Core | Browser | foregroundBrowser | searchTimeout
©
2017 CodeCentrix Software. All rights reserved.